/* Main layout */
body {
    margin: 0;
    padding: 0;
    font-family: "Barlow Semi Condensed", sans-serif;
    font-weight: 400;
    color: #2c3e50;
}

body.collection
{
    display: flex;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Adapts as browser UI appears/disappears */
    height: calc(var(--vh-unit, 1vh) * 100); /* Uses JS-updated value for better accuracy */
    overflow: hidden;
    position: fixed;
    inset: 0;
}

body.homepage {
    height: auto;          
    overflow-y: auto;     
    flex-direction: column; /* Changed from row for homepage */
 }

 dd { margin: 0; padding: 0; border: none; }

.responsive-logo {
    /* 1. Sets the maximum *possible* width (690px is the image's natural width) */
    max-width: 480px;
    min-width: 300px;
    /* 2. Ensures the image scales down to fit the container if the container is smaller than 690px */
    width: 100%;
    /* 3. Ensures the aspect ratio is maintained when scaling */
    height: auto;
}

p {
    font-family: "Lato", sans-serif;
    font-style: normal;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
}

/* Sidebar with map + Webcam list */
.sidebar {
    width: 350px;
    display: flex;
    flex-direction: column;
    background-color: #f0f2f5;
    border-right: 1px solid #ccc;
    z-index: 20;
}

#first-time-div {
    margin: 0 8px;
    overflow-y: auto;
    flex-grow: 1;
    padding-left: 20px;
    padding-right: 20px;
}

.map-container {
    height: 50%;
    position: relative;
    border-bottom: 1px solid #ccc;
}

#map {
    width: 100%;
    height: 100%;
}

.link-list {
    height: 50%;
    overflow-y: auto;
    padding: 15px;
    background: #ffffff;
}

.link-list h2 {
    margin-top: 0px
}

.link-item {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px 10px 10px 13px;
    margin-bottom: 10px;
    transition: background 0.3s;
    cursor: pointer;
}

.link-item:hover, .bottom-nav a.btn:hover {
    background: #f0f7ff;
}

.link-item.active {
    background-color: #f0f7ff; /* Light blue highlight */
    border-left: 4px solid #2196f3; /* Accent bar */
    transition: background-color 0.3s ease;
    padding-left: 10px; /* Adjust padding for border */
}

.link-name {
    font-size: 16px;
}

.link-details {
    display: flex;
    gap: 8px;         /* Keeps a consistent gap between all buttons */
    margin-top: 8px;
}

.btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: default;
    display: flex;
    align-items: center;
}

a .btn{
    cursor: pointer;
}

.btn.resort
{
    font-weight: 600;
    background-color: white;
    color: #2c3e50;
    border: 1px solid #bbb;
}

.btn.country
{
        background-color: #4caf50;
}

.link-list .btn.country
{
    margin-left: auto; /* Pushes this button and the next one to the right */
}

.btn.technology {
    background-color: darkcyan;
}

.btn.elevation {
    background-color: #2196f3;
}

.breadcrumb-separator {
    padding: 2px 0px 6px 0px;
    margin: 0px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

#link-title {
    padding: 4px 8px 4px 0px;
    margin: 0px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

/* Webcam display */
.link-view {
    flex: 1;
    background: #f8f9fa;
    padding: 13px 0px 0px 0px;
    display: flex;
    flex-direction: column;
}

.shadow-hidden {
    box-shadow: none;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

a:has(img) {
    text-decoration: none;
    color: inherit;
}

.link-iframe-container {
    flex: 1 1 auto;
    border: none;
    display: none;
    margin: 0px;
    padding: 0px 20px 0px 20px;
    background-color: inherit;
    z-index: 20;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;   /* VERY important on mobile */
}

#link-iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0px;
    margin: 0px;
    border-radius: 8px;
    flex-grow: 1;
    border: none;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.selecta {
    padding: 6px;
    font-family: Barlow Semi Condensed;
    font-size: 1.3em;
    font-weight: 600;
    border-radius: 5px;
    width: 100%;
}

.bottom-bar {
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    align-items: flex-start; /* Aligns items to the left */
    z-index: 10;
    padding: 13px 20px 13px 20px;
    margin: 0px;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
}

.bottom-nav
{
    width: 100%; /* Ensures the nav can use its internal space-between */
    display: flex;
    z-index: 10;
    padding: 0px;
    justify-content: space-between; 
    align-items: center;
    margin: 0px;
}

.bottom-nav .btn {
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

.button-group {
    display: flex;
    gap: 0.5rem;                    /* space between buttons */
}

.icon-btn {
    background-color: #666;
    border: 1px solid black;
    cursor: pointer;
    border-radius: 3px;
    display: flex;      /* ensures SVG stays centred */
    padding: 3px;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;      /* fill shapes */
    stroke: #ffffff;    /* outline strokes (if present) */
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-size: 1.5rem;
}
.toast.show {
    opacity: 1;
}

.navbar {
    padding: 13px 20px 0px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.collection .navbar {
    padding-left:20px;
    padding-top: 0px;
    padding-right: 35px;
}

.homepage .navbar {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-bottom: 13px;
}

.hamburger-btn svg {
    width: 30px;
    height: 30px;
    fill: #6c7e90;
}

/* --- HERO SECTION --- */
.hero-section {
    background-image: linear-gradient(rgba(200, 200, 255, 0.3), rgba(128, 128, 128, 0.3)), url('https://snow.obsession.cam/assets/coverimage.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-family: "Barlow Condensed", sans-serif;
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0.3rem 0.3rem 0.3rem rgba(0,0,0,0.4);
}

.hero-subtitle {
    font-family: "Barlow Semi Condensed", sans-serif;
    font-size: 1.5rem;
    margin-top: 10px;
    opacity: 0.9;
    text-shadow: 0.3rem 0.3rem 0.3rem rgba(0,0,0,0.4);
}

/* --- HOME MAP --- */
#home-map {
    width: 100%;
    height: 350px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    z-index: 1;
}

/* --- RESORT GRID --- */
.container {
    max-width: 1400px;
    margin: -40px auto 40px auto; /* Pull grid up slightly over map */
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* --- CARD STYLE --- */
.cluster-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.homepage .cluster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #2196f3;
}

.collection .tag-label, .collection .cam-badge, .collection .cluster-card .btn {
    font-size: 1.1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    padding-right: 0.5rem;
}

.card-cam-count {
    font-family: "Lato", sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-weight: 700;
}

.cam-badge {
    background-color: #f0f2f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #2c3e50;
}

.card-footer {
    margin-top: auto;
}

.tag-group {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

/* Specific Reset for Homepage */
body.homepage {
    display: block;
    height: auto;
    overflow-y: auto;
    background-color: #f0f2f5;
}

/* The Main Grid Container */
body.homepage .container {
    display: block;
    margin: -40px auto 60px auto; /* Increased bottom margin */
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

#main-heading { font-size: 2rem; }

/* --- NEW: Full Width Sections --- */

.full-width-section {
    width: 100%;
    padding: 80px 20px;
    box-sizing: border-box;
    /* Ensures anchors don't get hidden behind sticky nav */
    scroll-margin-top: 60px; 
}

.section-inner {
    max-width: 800px; /* Narrower than grid for better reading experience */
    margin: 0 auto;
}

/* About Section Style: Clean White */
#about {
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    color: #2c3e50;
}

/* Contact Section Style: Dark Footer */
#contact {
    background-color: #2c3e50;
    color: #ecf0f1;
}

/* Typography overrides for these sections */
.full-width-section h2 {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.full-width-section h3 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: inherit;
}

.full-width-section p {
    font-family: "Lato", sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    opacity: 0.9; /* Slightly softer text */
}

/* Links in About (Light background) */
#about a {
    color: #2196f3;
    text-decoration: none;
    font-weight: 700;
}
#about a:hover { text-decoration: underline; }

/* Links in Contact (Dark background) */
#contact a {
    color: #4caf50; /* Green pop for links on dark */
    text-decoration: none;
    font-weight: 700;
}
#contact a:hover { text-decoration: underline; color: #66bb6a; }


/* --- MENU OVERLAY (Hidden by default) --- */
.menu-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 300px;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 2000;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.menu-overlay.open { transform: translateX(0); }
.close-btn { align-self: flex-end; cursor: pointer; background:none; border:none; font-size: 1.5rem; }
.menu-link { display: block; padding: 15px 0; font-size: 1.2rem; text-decoration: none; color: #2c3e50; border-bottom: 1px solid #eee; }
.backdrop {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    display: none;
}
.backdrop.open { display: block; }

.visually-hidden, .info-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  transition: height 0.3s ease, clip 0.3s ease;

}

.tag-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

ul.link-list {
    list-style: none;
    margin: 0;
}

dl {
    margin: 0;
}

#first-time-div, .link-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
a.select-webcam,  #infobox a {
    color: inherit;
    text-decoration: none;
}

a.select-webcam {    
    display: block;
}

.bottom-nav a.btn {
    text-decoration: none;
}

a.select-webcam:hover .link-name dd, .bottom-nav a.btn:hover, #infobox a:hover {
    text-decoration: underline;
}
#infobox h1, #infobox h2 { font-size: 1.5rem; margin: 0;padding-bottom: 0.3rem;}
#infobox p { margin: 0px;}
#infobox
{
    width: 100%;
    flex: 1;
    flex-basis: 0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: background 0.3s;
    border: 1px solid #ddd;
    background-color: white;
    box-sizing: border-box;
}

#infobox td {padding-left: 0px; padding-right: 10px; vertical-align: baseline;}
#infobox table {padding: 0px; margin: 0px; border: 0px}
#infobox table td:first-child {
  font-weight: 600;
}

#infobox ul, ol { margin: 0px;list-style-type: none;padding: 0px;}

.grid-table {
    display: grid;
    margin-top: 4px;
    /* Col 1: Labels | Col 2: Info | Col 3: Copyright Box */
    grid-template-columns: max-content 1fr min-content; 
    column-gap: 20px;
    row-gap: 5px; /* Consistent vertical spacing */
    align-items: start;
    max-height: 25vh;
    overflow-y:auto;
    scrollbar-gutter: stable;
    /* 1. Default state: NO FADE (Solid) */
    /* This ensures that if there's no scrollbar, everything is visible */
    -webkit-mask-image: linear-gradient(to bottom, black 100%, black 100%);
    mask-image: linear-gradient(to bottom, black 100%, black 100%);
    /* 2. Link to scroll timeline */
    animation: fade-logic linear;
    animation-timeline: scroll(self);
}

@keyframes fade-logic {
    /* At the very start (top), show the fade */
    0% { 
        mask-image: linear-gradient(to bottom, black calc(100% - 30px), transparent 100%); 
        -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 30px), transparent 100%);
    }
    /* As soon as we scroll a tiny bit away from the top, keep the fade */
    1%, 90% { 
        mask-image: linear-gradient(to bottom, black calc(100% - 30px), transparent 100%); 
        -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 30px), transparent 100%);
    }
    /* When we hit the bottom, remove the fade */
    95%, 100% { 
        mask-image: linear-gradient(to bottom, black 100%, black 100%); 
        -webkit-mask-image: linear-gradient(to bottom, black 100%, black 100%);
    }
}

.label {
    grid-column: 1;
    font-weight: 600;
}

.content {
    grid-column: 2;
}

/* The box that sits in the top right */
.copyright-sidebar {
    font-family: 'Barlow Semi Condensed';
    font-size: smaller;
    grid-column: 3;
    grid-row: 1 / span 5; /* This makes it sit next to the first 5 rows */
    padding: 10px;
    border: 1px solid #ccc; /* Matching your red box in diagram */
    background: #fff;
    border-radius: 6px;
    margin-right: 1rem;
}

/* Rows that should go under the copyright box */
.full-width {
    grid-column: 2 / span 2; /* Spans across the center and the sidebar column */
}

/* Search Container - Start invisible/minimal */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 60px; /* Shorter than a full card but fits the grid */
    background: transparent;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Reveal the "Card" on Hover or when Input has text */
.search-container:hover,
.search-container.is-active {
    background: white;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 15px;
    border-color: #2196f3;
}

/* The Input Field */
.search {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.1rem;
    padding-right: 40px; /* Leave space for the icons */
    height: 40px;
}

/* Icon Styling - Positioned to the right */
.search-icon, .cancel-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;   /* Constrain the SVG size */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-icon svg  {
    width: 100%;
    height: 100%;
    fill: #6c7e90; 
    background: radial-gradient(circle closest-side, white, transparent);
    padding: 15px;
    margin-left: -15px;
}

.cancel-icon svg {
    width: 100%;
    height: 100%;
    fill: #6c7e90;
}

/* 5. Icon Toggle Logic */
.cancel-icon {
    opacity: 0;
    pointer-events: none;
}

/* When active, swap search for cancel */
.search-container.is-active .search-icon {
    opacity: 0;
}

.search-container.is-active .cancel-icon {
    opacity: 1;
    pointer-events: auto;
}

/* Match the hover effect of your cards */
.search-container:hover .search-icon svg {
    fill: #2196f3;
}