:root {
    --font-serif: 'Lora', 'Georgia', serif;
    --font-sans: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --color-text: #111111;
    --color-background: #ffffff;
    --color-border: #e0e0e0;
    --color-accent: #ffde3f;
    --color-signup-bg: #fefae0;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Offset for sticky header */
}
body {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden; /* Prevents horizontal overflow */
}
body.no-scroll {
    overflow: hidden;
}
/* --- MY ACCOUNT PANEL STYLES --- */
.account-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.account-panel-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.account-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--color-background);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    z-index: 5001;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}
.account-panel-overlay.is-open .account-panel {
    right: 0;
}

.account-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
#account-greeting {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0;
}
.account-panel-close-btn {
    background: none; border: none; font-size: 2.5rem;
    cursor: pointer; color: #999; padding: 0; line-height: 1;
}

.account-panel-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.account-section {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.5rem;
}
.account-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.account-section-title {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.account-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.account-input:disabled {
    background-color: #f5f5f5;
    color: #888;
}

.btn-account-save {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--color-text);
    color: var(--color-background);
    border: 1px solid var(--color-text);
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
}
.account-section-subsection {
    margin-top: 2rem;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.btn-account-action {
    width: 100%;
    text-align: left;
    padding: 0.8rem 1rem;
    background: none;
    border: 1px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 1rem;
    cursor: pointer;
}
.btn-account-action.btn-danger {
    color: #c00;
    border-color: #c00;
}

/* Newsletter Toggle Switch */
.newsletter-toggle { display: flex; justify-content: space-between; align-items: center; }
.newsletter-toggle p { margin: 0; font-size: 1rem; color: #333; max-width: 75%; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--color-text); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 28px; }
.slider.round:before { border-radius: 50%; }

/* --- LOADER --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    display: flex;
    /* Start with items side-by-side */
    flex-direction: row;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    /* Add a delay to the fade-out so the message can be read */
    transition: opacity 0.5s ease-out 0.5s;
}
#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* This new class will be added by JavaScript to change the layout */
#loader.is-typing {
    flex-direction: column;
}

.loader-icon {
    height: 60px;
    margin-right: 8px; /* Default margin for side-by-side layout */
}

/* Adjust the icon's margin when the layout changes to vertical */
#loader.is-typing .loader-icon {
    margin-right: 0;
    margin-bottom: 1rem;
}

.loader-cursor {
    display: inline-block; /* The original cursor is visible by default */
    width: 3px;
    height: 50px;
    background-color: var(--color-text);
    animation: blink 1s infinite;
}

/* Hide the original cursor when the typing animation starts */
#loader.is-typing .loader-cursor {
    display: none;
}

.loader-message {
    display: none; /* The message is hidden by default */
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 2rem;
    margin-top: 1rem;
    color: var(--color-text);
    min-height: 1.5em; /* Reserve space */
}

/* Show the message area when the typing animation starts */
#loader.is-typing .loader-message {
    display: block;
}

.loader-message::after {
    content: '|';
    display: inline-block;
    animation: blink 0.8s infinite;
    position: relative;
    top: -2px;
    opacity: 1;
}
.loader-message.typing-done::after {
    opacity: 0;
    transition: opacity 0.3s;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
/* --- MOBILE TOP BAR --- */
.mobile-top-bar {
    display: none;
    background-color: var(--color-accent);
    padding: 0.5rem 1rem;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1002;
}
.mobile-top-bar a {
    color: var(--color-text);
    text-decoration: none;
    padding: 0 0.5rem;
}
.mobile-top-bar a:hover {
    text-decoration: underline;
}
body.logged-in .mobile-top-bar {
    display: none;
}

/* --- HEADER --- */
.main-header {
    position: sticky; /* ADDED: Makes the entire header sticky */
    top: 0;           /* ADDED: Sticks it to the top */
    z-index: 1001;
    background-color: var(--color-background);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-shadow: none;
    box-sizing: border-box;
}
.simple-header {
    border-bottom: 1px solid var(--color-border);
}

.header-top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0.25rem 0rem;
    min-height: 55px;
    position: relative;
}
.top-bar-left { justify-self: start; display: flex; align-items: center; gap: 1.5rem; }
.user-actions { justify-self: end; display: flex; align-items: center; gap: 1.5rem; }

.header-branding {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.5rem 0;
    transition: all 0.3s ease-in-out;
}
.branding-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.branding-col-left { align-items: flex-start; }
.branding-col-right { align-items: flex-end; }
.branding-icon { height: 60px; }
.env-icon { height: 50px; }
.logo {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(3.5rem, 10vw, 5rem);
    text-transform: uppercase;
    letter-spacing: -0.08em;
    margin: 0;
    color: var(--color-text);
    line-height: 1;
    white-space: nowrap;
    transition: font-size 0.3s ease-in-out;
    padding: 0 1rem;
}
.header-date {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.5rem 0 0 0;
    text-align: center;
}
.main-nav {
    /* REMOVED: position: sticky; */
    /* REMOVED: top: 0; */
    z-index: 1001;
    background-color: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}
.main-nav ul {
    display: flex; justify-content: center; align-items: center;
    gap: 1.5rem; /* Reduced gap */
    list-style: none; margin: 0; padding: 0;
}
.main-nav ul li a {
    display: block;
    font-family: var(--font-sans);
    font-weight: 400; /* Default to normal weight for dynamic nav */
    font-size: 0.8rem;
    color: var(--color-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    padding: 0.8rem 0;
    padding-bottom: calc(0.8rem - 4px); 
    border-bottom: 4px solid transparent;
    transition: border-bottom-color 0.3s ease, font-weight 0.3s ease;
    white-space: nowrap; /* Prevent wrapping */
}

/* Style for the original, static navigation state */
.main-nav.original-nav ul li a {
    font-weight: 700;
    padding: 0.8rem 1rem;
    padding-bottom: calc(0.8rem - 4px);
}

.main-nav ul li a.active-link {
    border-bottom-color: var(--color-accent); 
    font-weight: 700; /* Make active link bold in both nav states */
}

.main-nav a:hover { color: #888; }

/* Styles for the dynamic navigation components */
.main-nav:not(.original-nav) ul {
    justify-content: center; /* Changed from flex-start to center */
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.main-nav:not(.original-nav) ul::-webkit-scrollbar {
    display: none;
}
.main-nav ul li.nav-section-title a {
    font-weight: 700;
    cursor: default;
}

.main-nav ul li.nav-separator a {
    font-weight: 400;
    color: #999;
    cursor: default;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.main-nav ul li.nav-section-title a,
.main-nav ul li.nav-separator a {
    border-bottom-color: transparent; /* No underline on title or separator */
}
.main-nav ul li a.next-section-link {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}
.main-nav ul li a.next-section-link:hover {
    opacity: 1;
}

.top-bar-left .nav-link,
.user-actions .nav-link,
.user-actions .btn {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
    color: var(--color-text);
}
.user-auth-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.user-actions .btn {
    padding: 0.7rem 1.2rem;
    border-radius: 0;
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}
.user-actions .btn:hover {
    background-color: #e6c938;
}
.search-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.scrolled-logo-link {
    display: none;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 2.5rem;
    letter-spacing: -0.08em;
    color: var(--color-text);
    text-decoration: none;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.main-header.scrolled .header-branding { display: none; }
.main-header.scrolled .scrolled-logo-link { display: block; }

/* --- MAIN CONTENT & HOMEPAGE SECTIONS --- */
.content-wrapper {
    margin: 3rem auto; padding: 0 1rem;
}
.main-article { background: var(--color-background); }
.eyebrow-container { display: flex; align-items: center; gap: 10px; margin-bottom: 0.5rem; }
.harry-icon { width: 38px; height: 38px; object-fit: contain; }
.eyebrow { font-family: var(--font-sans); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; display: block; margin: 0; }
.article-title { font-family: var(--font-serif); font-size: 3.2rem; font-weight: 400; line-height: 1.15; margin-top: 0; margin-bottom: 1rem; }
.main-article p { font-size: 1.15rem; line-height: 1.8; color: #000; }
.main-article .article-title { font-size: 2.8rem; }

/* Styles for "Show More" functionality */
.article-body-wrapper {
    position: relative;
    transition: max-height 0.5s ease-out;
    overflow: hidden;
}
.article-body-wrapper.truncated {
    max-height: 250px; /* Adjust this value to control how much text is shown initially */
}
.article-body-wrapper.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--color-background));
    pointer-events: none;
}
.show-more-container {
    text-align: center;
    margin-top: 1.5rem;
}
.show-more-btn {
    background: none;
    border: none;
    color: #888;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0;
    cursor: pointer;
    transition: color 0.2s;
}
.show-more-btn:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    border-top: 1px solid var(--color-border);
}
.section-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 3rem;
    text-align: center;
}

/* --- INNER PAGE STYLES (ABOUT, HOW IT WORKS) --- */
.page-header {
    text-align: center;
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
.page-header h1 {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.05em;
}
.content-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}
.feature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin: 0 auto 4rem;
}
.feature-section.reverse .feature-image {
    order: 2;
}
.feature-image img {
    width: 100%;
    height: auto;
    display: block;
}
.feature-text h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    margin-top: 0;
}
.feature-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

/* --- TYPE-ON-SCROLL ANIMATION STYLES --- */
.section-title-container {
    position: relative;
    text-align: center;
    margin-bottom: 3rem;
}
.typewriter-subtitle {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 1.8rem;
    color: var(--color-text); /* Changed to black */
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    min-height: 2.5em; /* Reserve space */
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.typewriter-subtitle.fade-out {
    opacity: 0;
}
.original-title {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease-in-out 0.2s; /* Add delay */
    margin: 0; /* Override default h2 margin */
}
.original-title.fade-in {
    opacity: 1;
}
.typewriter-subtitle::after {
    content: '|';
    display: inline-block;
    animation: blink 0.7s infinite;
    position: relative;
    top: -2px;
}
.typewriter-subtitle.typing-done::after {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Styles for hiding/showing section content */
.animated-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.3s, transform 0.6s ease-out 0.3s;
}
.animated-content.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* Styles for article-style sections (Essentials, Imports, Deliveries) */
.essentials-container {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}
.essential-item {
    text-align: left;
    border-top: 1px solid var(--color-border);
    padding-top: 2.5rem;
}
.essential-item:first-child {
    border-top: none;
    padding-top: 0;
}
.essential-item .item-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 400;
}
.essential-item .item-description {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

/* --- Styles for The Gazette Map --- */
.map-container {
    margin: 2rem auto 3.5rem auto;
    padding: 0 1rem;
}
.map-image {
    width: 100%;
    max-width: 1100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Brief Sidebar --- */
.brief-sidebar {
    background-color: #f2f2f2; /* Light grey background */
    border: 1px solid var(--color-border);
    padding: 2rem 1.5rem;
    color: var(--color-text);
    position: relative;
    border-radius: 12px; /* Curved edges */
}
.sidebar-pin {
    position: absolute;
    top: -1px; /* Position at the very top */
    left: 1.5rem;
    color: var(--color-text);
    width: 28px;
    height: 36px;
}
.sidebar-meta {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-top: 2.5rem; /* Reduced space for pin */
    margin-bottom: 0.5rem;
}

.brief-sidebar-title {
    font-family: var(--font-serif);
    font-weight: 400; /* Regular weight */
    font-size: 2rem; /* Larger font size */
    letter-spacing: -0.5px;
    margin-top: 0; 
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 8px solid var(--color-text); /* Thicker black underline */
    position: static;
    padding-top: 0;
    text-transform: none; /* remove uppercase */
    color: var(--color-text);
}
.brief-sidebar-title::before {
    content: none;
}
.brief-content ul {
    list-style-type: disc;
    margin: 1.5rem 0 0 0;
    padding-left: 1.2rem; /* Indent bullets */
    display: flex;
    flex-direction: column;
    gap: 1.25rem; /* Space between bullets */
}
.brief-content li {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.6;
    padding-left: 0.5rem;
    color: #333;
}
.brief-content li strong {
    color: var(--color-text);
}


/* Cannoli Section styles */
.cannoli-section-content {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: flex-start;
    gap: 2rem; 
    max-width: 1100px; 
    margin: 0 auto;
    padding: 0 1rem; 
}
.cannoli-text-content {
    flex: 1; 
    min-width: 300px; 
    max-width: 700px;
    text-align: left;
}
.cannoli-image-container {
    flex-shrink: 0; 
    width: 100%; 
    max-width: 300px;
    text-align: center;
}
.cannoli-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- About Us Page Team Grid --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.team-member {
    text-align: center;
}
.team-member img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin: 0 auto 1rem;
}
.team-member h3 {
    margin: 0.5rem 0;
    font-size: 1.2rem;
    font-family: var(--font-serif);
}
.team-member p {
    margin: 0;
    color: #666;
    font-family: var(--font-sans);
}


/* --- Helper Styles & Mobile Nav --- */
.menu-toggle { background: none; border: none; cursor: pointer; padding: 0.5rem; display: flex; flex-direction: column; gap: 5px; }
.hamburger-line { display: block; width: 24px; height: 2px; background-color: var(--color-text); }
.search-icon svg { width: 18px; height: 18px; }
.how-it-works, .desktop-only { display: none; }
.mobile-only-icon { display: block; }
.mobile-only-icon img { height: 30px; vertical-align: middle; }
.hidden { display: none !important; }

.mobile-nav { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--color-background); z-index: 2000; transform: translateX(-100%); transition: transform 0.3s ease-in-out; padding: 1rem; box-sizing: border-box; overflow-y: auto; text-align: left; }
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav-header { 
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%; 
    min-height: 55px; 
    align-items: center; 
}
.mobile-nav-header .close-menu-btn { justify-self: start; }
.mobile-nav-header .mobile-nav-logo { justify-self: center; }
.close-menu-btn { background: none; border: none; cursor: pointer; font-size: 3rem; line-height: 1; padding: 0; color: var(--color-text); }
.mobile-nav-logo { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 400; color: var(--color-text); text-decoration: none; text-transform: uppercase; letter-spacing: -0.06em; }
.mobile-nav-links { list-style: none; padding: 0; margin: 2rem 0 0 0; }
.mobile-nav-links li a { display: block; font-family: var(--font-serif); font-size: 2.2rem; font-weight: 400; color: var(--color-text); text-decoration: none; padding: 0.5rem 0; }
.mobile-nav-links li a:hover { color: #888; }
.mobile-nav-links .has-arrow { display: flex; align-items: center; justify-content: space-between; }
.mobile-nav-links .has-arrow svg { width: 30px; height: 30px; }
.mobile-nav-links .sub-link { display: block; font-family: var(--font-sans); font-size: 1rem; color: #888; margin-top: 0.25rem; }
.mobile-nav-divider { border: 0; border-top: 1px solid var(--color-text); margin: 2rem 0; }
.secondary-links li a { font-size: 1.5rem; }

/* --- SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.search-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
}
.search-modal-content {
    width: 90%;
    max-width: 600px;
}
.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-text);
    font-family: var(--font-serif);
    font-size: 2.5rem;
    text-align: center;
    padding: 0.5rem;
}
.search-input:focus {
    outline: none;
}

/* --- MODAL OVERLAY --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center; align-items: center; z-index: 3000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal-content { background-color: var(--color-background); padding: 2rem; border-radius: 0; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); width: 90%; max-width: 400px; position: relative; transform: translateY(20px); transition: transform 0.3s ease; box-sizing: border-box; }
.modal-overlay.is-open .modal-content { transform: translateY(0); }
.subscription-card { border: 1px solid var(--color-border); background-color: #fcfcfc; }
.modal-close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--color-text); line-height: 1; padding: 0; opacity: 0.7; transition: opacity 0.2s ease; }
.modal-close-btn:hover { opacity: 1; }
.modal-header-text { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 400; text-align: center; margin-top: 0.5rem; margin-bottom: 2rem; color: var(--color-text); }
.modal-tagline { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 400; line-height: 1.3; color: var(--color-text); margin: 1rem 0 1.5rem 0; text-align: left; min-height: 3.9em; }
.modal-tagline.typing-active::after { content: '|'; display: inline-block; animation: blink 0.7s infinite; font-weight: 300; position: relative; top: -2px; color: #888; }
.modal-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
#joinFormStep1 { opacity: 0; transform: translateY(10px); transition: opacity 0.4s ease-out, transform 0.4s ease-out; }
#joinFormStep1.form-visible { opacity: 1; transform: translateY(0); }
.form-label { font-family: var(--font-sans); font-weight: 700; font-size: 0.85rem; color: #555; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: -0.5rem; }
.form-input { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--color-border); border-radius: 0; font-family: var(--font-sans); font-size: 1rem; color: var(--color-text); box-sizing: border-box; background-color: var(--color-background); transition: border-color 0.2s ease; }
.form-input::placeholder { color: #aaa; }
.form-input:focus { outline: none; border-color: var(--color-accent); }
.modal-btn { display: block; width: 100%; padding: 1rem 1.5rem; background-color: var(--color-accent); color: var(--color-text); border: none; border-radius: 0; font-family: var(--font-sans); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: background-color 0.2s ease; margin-top: 1rem; }
.modal-btn:hover { background-color: #e6c938; }
.modal-links { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.modal-link-btn { background: none; border: none; color: #555; font-family: var(--font-sans); font-size: 0.9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; transition: opacity 0.2s ease, color 0.2s ease; }
.modal-link-btn:hover { color: var(--color-text); opacity: 1; }

/* ADDED: Style for the dynamically inserted Back button */
.join-back-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
}
.join-back-btn.back-arrow {
    /* Style for the Unicode arrow character */
    font-size: 1.2rem;
    padding-right: 0.5rem;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 1rem; align-items: flex-end; }
.toast { font-family: var(--font-sans); padding: 1rem 1.5rem; border-left: 5px solid; box-shadow: 0 3px 10px rgba(0,0,0,0.1); background-color: var(--color-background); border-radius: 0; animation: toastSlideIn 0.4s ease-out forwards; opacity: 0; min-width: 250px; font-size: 0.95rem; }
.toast.toast-exit { animation: toastSlideOut 0.4s ease-in forwards; }
.toast-success { border-color: #4CAF50; }
.toast-error { border-color: #f35b50; }
.toast-info { border-color: var(--color-accent); }
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* --- STICKY SIGNUP BANNER --- */
.sticky-signup-banner {
    position: fixed;
    bottom: -100%; /* Initially hidden */
    left: 0;
    width: 100%;
    background-color: var(--color-accent);
    color: var(--color-text);
    z-index: 2000;
    padding: 3rem 2rem;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    transition: bottom 0.5s ease-in-out;
    box-sizing: border-box;
}
.sticky-signup-banner.is-visible {
    bottom: 0;
}
.sticky-signup-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.sticky-signup-text h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}
.sticky-signup-text p {
    font-family: var(--font-sans);
    margin: 0;
    max-width: 400px;
}
.sticky-signup-form {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
    justify-content: flex-end;
}
.sticky-form-step {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
}
.sticky-input {
    flex-grow: 1;
    border: 1px solid var(--color-text);
    padding: 0.8rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    min-width: 150px;
}
.sticky-input::placeholder {
    color: #555;
}
.sticky-input:focus {
    outline: 2px solid var(--color-text);
}
.sticky-btn {
    background-color: var(--color-text);
    color: var(--color-background);
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
/* --- COMMENTING FEATURE STYLES --- */

/* "Add Comment" button that appears on highlight */
#comment-trigger {
    position: absolute;
    background-color: var(--color-text);
    color: var(--color-background);
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 1010; /* Increased z-index */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* Modal form for writing a comment */
.comment-form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3500;
}

.comment-form-content {
    background-color: var(--color-background);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    font-family: var(--font-sans);
}

.comment-form-content h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-top: 0;
}

.comment-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #888;
}

.comment-quote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #555;
    font-size: 0.95rem;
}

.comment-form-content textarea {
    width: 100%;
    height: 100px;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 1rem;
    margin-bottom: 1rem;
    resize: vertical;
}

.comment-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#comment-post-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--color-accent);
    border: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
}

/* Dotted underline for commented text */
.comment-highlight {
    text-decoration: underline dotted var(--color-text);
    text-decoration-thickness: 2px;
    background-color: rgba(255, 222, 63, 0.2);
    cursor: pointer;
}

/* --- REPLACED/NEW COMMENT STYLES START HERE --- */

/* This replaces the old #comment-view style */
#comment-view {
    position: absolute;
    background: var(--color-background);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--color-border);
    z-index: 100;
    padding: 0; 
    min-width: 300px;
}

.comment-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background-color: #fcfcfc;
}

.comment-author {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text);
}

.comment-view-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    transition: color 0.2s ease;
}
.comment-view-close-btn:hover {
    color: var(--color-text);
}

#comment-view .comment-body {
    padding: 1.25rem;
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

/* New styles for the reply functionality */
.comment-footer {
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.reply-btn {
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
}
.reply-btn:hover {
    color: var(--color-text);
}

.replies-container {
    background-color: #fcfcfc;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--color-border);
}

.reply {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}
.reply:last-child {
    border-bottom: none;
}

.reply-author {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.reply-body {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    color: #444;
}

.reply-form-container {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.reply-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    min-height: 60px;
    margin-bottom: 0.75rem;
}

.post-reply-btn {
    background-color: var(--color-text);
    color: var(--color-background);
    border: none;
    padding: 0.6rem 1rem;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

/* --- END OF NEW COMMENT STYLES --- */


/* Sidebar on wide screens */
.comment-display-sidebar {
    width: 320px;
    position: absolute; /* Changed from fixed to absolute for better flow */
}

/* Pop-up on narrow screens */
.comment-display-popup {
    width: 80%;
    max-width: 350px;
}

/* --- FOOTER --- */
.main-footer {
    border-top: 1px solid var(--color-border);
    padding: 3rem 1rem;
    background-color: var(--color-background);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}
.footer-logo {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: -0.06em;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
    margin-bottom: 0.5rem;
}
.footer-logo:hover {
    color: #888;
}
.footer-tagline {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--color-text);
    margin: 0;
    letter-spacing: 0.2px;
}
.footer-copyright {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #888;
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
    .mobile-top-bar { display: block; }
    .main-header { top: 36px; }
    body.logged-in .main-header { top: 0; }
    .header-branding { grid-template-columns: 1fr; padding: 1rem 0; }
    .branding-col-left, .branding-col-right { display: none; }
    
    .logo {
        font-size: clamp(2.8rem, 12vw, 4rem); /* Adjusted font size for mobile */
    }

    .main-nav ul { justify-content: flex-start; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
    .main-nav ul::-webkit-scrollbar { display: none; }
    .article-title { font-size: 2.5rem; }
    .desktop-only { display: none; }
    .mobile-only-icon { display: block; }
    .scrolled-logo-link { font-size: 2rem; position: static; transform: none; text-align: center; width: 100%; }
    .feature-section, .feature-section.reverse { grid-template-columns: 1fr; }
    .feature-section.reverse .feature-image { order: 1; }
    .sticky-signup-content { flex-direction: column; text-align: center; }
    .sticky-signup-form { justify-content: center; }
    .content-section { padding: 3rem 1rem; }
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    
    /* Adds divider between sidebar and article on mobile */
    #welcome .main-article {
        border-top: 1px solid var(--color-border);
        margin-top: 2rem;
        padding-top: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .desktop-only { display: flex; }
    .mobile-only-icon { display: none; }
}

@media (min-width: 1024px) {
    .how-it-works { display: block; }
    .desktop-only { display: flex; }
    .mobile-only-icon { display: none; }
    
    #welcome.content-wrapper {
        display: grid;
        align-items: flex-start;
        max-width: 1100px;
        grid-template-columns: 1.1fr 2fr;
        gap: 4rem;
    }
    #welcome .sidebar-container {
        grid-column: 1;
        position: static;
    }
    #welcome .main-article {
        grid-column: 2;
    }

    .cannoli-section-content {
        justify-content: space-between;
    }
    .cannoli-text-content {
        padding-right: 2rem;
    }
    .cannoli-image-container {
        width: auto;
    }
    
    .comment-display-sidebar {
        left: calc(100% + 2rem);
    }
}

/* --- DRAGGABLE COMMENT STYLES --- */

/* On medium screens and up, make the header a drag handle */
@media (min-width: 769px) {
    #comment-view .comment-view-header {
        cursor: move;
    }
}

/* Optional: Add a subtle style when the box is actively being dragged */
#comment-view.is-dragging {
    opacity: 0.9;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .modal-content { padding: 1.5rem; }
    .modal-header-text, .modal-tagline { font-size: 1.8rem; }
    .page-header h1 { font-size: 2.5rem; }
    .feature-text h2 { font-size: 1.8rem; }
    .modal-close-btn { font-size: 2rem; top: 0.75rem; right: 0.75rem; }
    .modal-btn { padding: 0.8rem 1rem; }
    #toast-container { right: 1rem; bottom: 1rem; width: calc(100% - 2rem); }
    .team-grid { grid-template-columns: 1fr; }
}

/* --- COLLAPSIBLE ACCOUNT SECTION STYLES --- */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Remove bottom margin from title inside a collapsible header */
.collapsible-header .account-section-title {
    margin-bottom: 0;
}

.collapsible-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.collapsible-header.is-open .collapsible-arrow {
    transform: rotate(180deg); /* Points the arrow up */
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding-top 0.4s ease-out;
    padding-top: 0;
}

.collapsible-content.is-open {
    max-height: 500px; /* A large value to allow for content expansion */
    padding-top: 1.5rem;
}

/* --- "HOW IT WORKS" PANEL STYLES --- */
.account-panel.from-left {
    right: auto;
    left: -100%; /* Start off-screen to the left */
    box-shadow: 5px 0 25px rgba(0,0,0,0.15); /* Shadow on the right side */
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Animate the 'left' property */
}

.account-panel-overlay.is-open .account-panel.from-left {
    left: 0;
    right: auto;
}
    
#how-it-works-panel .account-panel-header h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0;
}
    
#how-it-works-panel .item-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
}

#how-it-works-panel .item-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1rem;
}

#how-it-works-panel .item-description:last-child {
    margin-bottom: 0;
}

#how-it-works-panel .item-description strong {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-text);
}

/* --- MOBILE ICON SPACING --- */
.user-actions {
    gap: 0.5rem; /* Adjusts space between mobile icons */
}
.mobile-only-icon svg {
    display: block; /* Ensures proper alignment */
}
/* --- MOBILE ACCOUNT ICON STYLES --- */

/* Set the icon color to black */
#mobile-account-trigger {
    color: var(--color-text);
}

/* Hide the icon by default */
#mobile-account-trigger {
    display: none;
}

/* On ALL screens, show the icon if the user is logged in */
body.logged-in #mobile-account-trigger {
    display: flex; /* Use flex to vertically align the SVG icon */
    align-items: center;
}

/* --- WEEKDAY CLOSED OVERLAY STYLES --- */
#weekday-closed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 9999;
    padding: 1rem;
    box-sizing: border-box;
}

#weekday-message-placeholder {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-text);
    min-height: 1.5em;
}

/* Blinking cursor for typewriter effect */
#weekday-message-placeholder::after {
    content: '|';
    display: inline-block;
    animation: blink 0.8s infinite;
    position: relative;
    top: -4px;
    opacity: 1;
}

#weekday-message-placeholder.typing-done::after {
    opacity: 0;
    transition: opacity 0.3s;
}

.weekday-signup-form {
    margin-top: 3rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
}

.weekday-signup-form.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.weekday-signup-form label {
    display: block;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.weekday-input-group {
    display: flex;
    justify-content: center;
    max-width: 450px;
    margin: 0 auto;
    border: 1px solid var(--color-text);
}

.weekday-input-group input {
    flex-grow: 1;
    border: none;
    padding: 0.8rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    min-width: 150px;
    background: transparent;
}
.weekday-input-group input:focus {
    outline: none;
}

.weekday-input-group button {
    background-color: var(--color-text);
    color: var(--color-background);
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
