html,
body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    max-width: 700px !important;
    margin: 0 auto;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════
   STICKY HEADER & SINGLE SCROLL CONTAINER
   Static pages only (index.html does not load alt_styles.css)
   ═══════════════════════════════════════════════════ */

/* Sticky navigation bar — W logo + title + dark mode toggle.
   The parent wrapper has padding:10px, so we use negative margin to
   extend the header background edge-to-edge, then re-add padding so
   content sits at the same visual position as before. */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--background-color);
    margin: -10px -10px 0 -10px;
    padding: 2px 2px 0 2px;
}

/* Override .alt-title-row negative margins inside the sticky header.
   The header's own margin/padding now handles edge-to-edge positioning. */
header .alt-title-row {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

/* Remove nested scroll from drawer-content on static pages.
   In the game (index.html), .drawer-content lives inside a position:fixed
   .drawer and needs its own scroll. On static pages it's inside <main>
   and the body should be the only scroll container. */
main .drawer-content {
    overflow-y: visible !important;
    overflow-x: visible !important;
    max-height: none !important;
    height: auto !important;
    padding-bottom: 20px;
}

.archive-container {
    width: 100%;
    max-height: 80vh;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 30px;
    padding-right: 30px;
    overflow-y: auto;    /* Enable vertical scrolling */
    overflow-x: hidden;    /* Prevent horizontal scrolling */
    
}


.alt-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;

    margin-left: -8px;
    margin-right: -8px;
    margin-top: -8px;
    margin-bottom: 10px;
  
    
    width: 100%;
}

.home-logo {
    display: flex;
    align-items: center;
}

.alt-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;     
    margin-bottom:10px;
    text-align: center;
    flex: 1;                /* center column expands */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width:75%;
}

.alt-subtitle {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;              /* remove bottom margin */
    text-align: center;
}


.month-block {
    margin-bottom: 20px;
    margin-left:2px;
}

.month-title {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0 6px 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: var(--text-color);
}

.calendar-cell {
    background: var(--wordcels-green);
    color: var(--text-color-darker);
    border: 1px solid var(--button-border-color);
    border-radius: 8px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calendar-cell:hover {
    filter: brightness(1.05);
}

.holiday {
    background: var(--wordcels-green);
    border: 2px solid var(--button-border-color);
}

.holiday::after {
    content: "★";
    position: absolute;
    top: -2px;
    right: 2px;
    font-size: 14px;
    color: var(--star-color, var(--text-color-darker));
}


.calendar-cell.empty {
    background: transparent;
    border: none;
}

.day-link {
    text-decoration: none;
    color: var(--text-color-darker);
    font-weight: bold;
    font-size: 16px;
}

.calendar-cell:hover {
    background: var(--calendar-hover-bg);
}

.calendar-date-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-date-link:hover {
    text-decoration: underline;
    cursor: pointer;
}


.today {
    outline: 2px solid var(--group-right-loc-color);
}

.calendar-legend { 
    display:flex;
    flex-direction:row;
    align-items: center;
    margin: 15px;
    
}

.legend-text {
    display:flex;
    flex-direction:row;
    align-items: center;
    font-size:14px;
    margin-right:5px;
}

/* ═══════════════════════════════════════════════════
   EXPRESSION PAGES — Editorial Design
   ═══════════════════════════════════════════════════ */

/* --- Expression Hero (title + badges + date) --- */

.expression-hero {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--wordcels-green);
}

.expression-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 10px 0;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

@media (max-width: 500px) {
    .expression-title {
        font-size: 28px;
    }
}

.expression-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 3px;
    margin-right: 6px;
    margin-bottom: 10px;
    color: white;
}

.expression-type-badge.featured {
    background-color: #2e8b57;
}

.expression-type-badge.fossil {
    background-color: #8b6914;
}

.expression-type-badge.shakespeare {
    background-color: #6a3d9a;
}

.shakespeare-quote {
    font-style: italic;
    color: var(--text-color);
    border-left: 3px solid #6a3d9a;
    padding: 12px 16px;
    margin: 12px 0;
    background: rgba(106, 61, 154, 0.05);
    border-radius: 0 6px 6px 0;
}

.dark-mode .shakespeare-quote {
    background: rgba(106, 61, 154, 0.08);
}

.expression-date {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--unavailable-text-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--wordcels-green);
}

/* When inside hero wrapper, hero provides the border */
.expression-hero .expression-date {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* --- YouTube Embeds --- */

.youtube-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.youtube-short {
    width: 60%;
    max-width: 360px;
    padding-bottom: 106%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 500px) {
    .youtube-short {
        width: 80%;
        padding-bottom: 142%;
    }
}

/* --- Expression Content --- */

.expression-content {
    font-size: 16px;
    line-height: 1.72;
    color: var(--text-color);
    margin-bottom: 20px;
}

.expression-content p {
    margin: 0 0 14px 0;
}

.expression-quote blockquote {
    border-left: 3px solid var(--wordcels-green);
    margin: 16px 0;
    padding: 12px 20px;
    font-style: italic;
    color: var(--text-color);
    background: var(--expression-accent-bg);
    border-radius: 0 6px 6px 0;
}

/* --- Section Titles --- */

.expression-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--unavailable-text-color);
    margin: 0 0 14px 0;
    padding-top: 24px;
    border-top: 1px solid var(--expression-section-border);
}

/* --- Puzzle Appearances --- */

.expression-puzzles {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.8;
}

.expression-puzzles ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
}

.expression-puzzles li {
    margin-bottom: 2px;
}

/* --- Ngram Chart --- */

.expression-chart-container {
    width: 100%;
    height: 250px;
    margin-bottom: 6px;
}

.ngram-credit {
    font-size: 11px;
    color: var(--unavailable-text-color);
    margin: 4px 0 24px 0;
    text-align: right;
    font-style: italic;
}

.ngram-credit a {
    font-size: inherit;
    color: inherit;
}

.ngram-credit a:hover {
    color: var(--wordcels-blue);
}

/* --- Navigation --- */

.expression-nav {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 30px 0;
    font-size: 14px;
}

.expression-nav-tight {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 8px;
    padding: 14px 0;
    font-size: 14px;
}

.eotd-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--expression-section-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: background 0.15s ease, border-color 0.15s ease;
    line-height: 1.3;
}

.eotd-nav-btn:hover {
    background: var(--expression-card-hover-bg);
    border-color: var(--wordcels-green);
}

.eotd-nav-empty {
    border-color: transparent;
}

.eotd-nav-empty:hover {
    background: none;
    border-color: transparent;
}

.eotd-nav-prev {
    text-align: left;
}

.eotd-nav-center {
    flex: 0 0 auto;
    align-items: center;
    font-weight: 600;
    color: var(--wordcels-blue);
    padding: 8px 16px;
}

.eotd-nav-next {
    text-align: right;
}

.eotd-nav-phrase {
    font-weight: 500;
    color: var(--wordcels-blue);
}

.eotd-nav-date {
    font-size: 12px;
    color: var(--text-color-lighter);
    margin-top: 2px;
}

/* --- Inline Links --- */

.inline-link {
    color: var(--wordcels-blue);
    text-decoration: none;
    transition: color 0.15s ease;
}

.inline-link:hover {
    text-decoration: underline;
}

/* --- CTA Section --- */

.expression-cta {
    background: var(--expression-section-bg);
    border-radius: 12px;
    padding: 28px 24px 32px;
    margin-top: 8px;
}

.expression-cta .expression-section-title {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.expression-cta .expression-content {
    font-size: 15px;
}

/* --- Expression Search --- */

.expression-search {
    position: relative;
    margin-bottom: 20px;
}

.expression-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--expression-section-border);
    border-radius: 10px;
    background: var(--background-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.expression-search-input:focus {
    border-color: var(--wordcels-green);
    box-shadow: 0 0 0 3px var(--expression-accent-bg);
}

.expression-search-input::placeholder {
    color: var(--unavailable-text-color);
}

.expression-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--background-color);
    border: 1px solid var(--expression-section-border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.dark-mode .expression-search-results {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.expression-search-results.open {
    display: block;
}

.expression-search-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    border-bottom: 1px solid var(--expression-section-border);
    transition: background-color 0.1s ease;
}

.expression-search-item:last-child {
    border-bottom: none;
}

.expression-search-item:hover,
.expression-search-item.active {
    background: var(--expression-card-hover-bg);
}

.expression-search-item mark {
    background: transparent;
    color: var(--wordcels-blue);
    font-weight: 600;
}

/* --- Expression Card Listing --- */

.expression-card {
    padding: 16px 0;
    border-bottom: 1px solid var(--expression-section-border);
    transition: background-color 0.12s ease;
}

.expression-card:last-child {
    border-bottom: none;
}

.expression-card:hover {
    background-color: var(--expression-card-hover-bg);
}

.expression-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.2px;
}

.expression-card-meta {
    font-size: 12px;
    color: var(--unavailable-text-color);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expression-card-snippet {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    display: flex;
    justify-content: space-between;
    padding: 24px 0 36px 0;
    font-size: 15px;
}

/* Dark mode toggle on static pages */
.alt-dark-mode-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 28px;
    color: var(--text-color);
    padding: 4px;
    margin-right: 5px;
}

/* About page */
.about-logo {
    display: flex;
    justify-content: center;
    margin: 20px 0 16px 0;
}

.about-logo img {
    width: 70%;
    max-width: 300px;
}

.about-intro {
    text-align: center;
    font-size: 16px;
    margin: 0 0 20px 0;
}

.about-nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 15px;
}

.about-nav-sep {
    color: var(--unavailable-text-color);
}

.about-section-title {
    font-size: 20px;
    font-weight: bold;
    margin: 24px 0 8px 0;
}

.about-video-container {
    position: relative;
    margin: 16px 0;
}

.about-video {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.video-mute-toggle {
    position: absolute;
    bottom: 16px;
    left: 12px;
    background: var(--video-overlay-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--button-text-on-color);
    font-size: 22px;
    padding: 0;
}

.video-mute-toggle:hover {
    background: var(--video-overlay-hover-bg);
}

.about-video-small {
    overflow: hidden;
    border-radius: 8px;
}

.about-video-small .about-video {
    transform: scale(1.1);
    transform-origin: top center;
}

.video-play-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--video-overlay-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--button-text-on-color);
    font-size: 22px;
    padding: 0;
    transition: opacity 0.4s ease;
}

.video-play-toggle.faded {
    opacity: 0;
    pointer-events: none;
}


.video-play-toggle:hover {
    background: var(--video-overlay-hover-bg);
}