 :root {
    --slider-max-w: 1200px;
    --gap: 1.5rem;
    --btn-size: 42px;
    --accent: #222;
    --muted: #666;
  }

  body {
    font-family: Georgia, serif;
    margin: 0;
    padding: 0;
    background: #fafafa;
    color: #111;
  }

body.dark-mode {
  background: #1a1a1a;
  color: #eee;
} 

a {color: #111;text-decoration:none;}
h1, h2, h3, h4, h5 {
  font-family: Cheltenham, Georgia, serif;
}
h1 {font-size:1.4rem;}
h2 {font-size:1.2rem;}
h3 {font-size:1rem;}
h4 {font-size:.9rem;}
h5 {font-size:.8rem;}


body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5 {color:#eee;}


/* ===== Footer ===== */
.site-footer {
  background: #222;
  color: #eee;
  padding: 2.5rem 1rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--slider-max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #fff;
}

.footer-col p,
.footer-col li,
.footer-col a {
  font-size: .95rem;
  line-height: 1.6;
  color: #ddd;
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* responsive: stack columns on mobile */
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ===== Footer Bottom Strip ===== */
.footer-bottom {
  background: #111;
  color: #aaa;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
  margin-top: 1rem;
}

.footer-bottom a {
  color: #aaa;
  text-decoration: none;
  margin: 0 .5rem;
}

.footer-bottom a:hover {
  color: #fff;
}

/* ==========
   Header & Nav
   ========== */
header {
  background: #111;
  color: #fff;
  padding: 20px;
  text-align: center;
  position: relative;
}

header h1 {
  color: #fff !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

header p {
  color: #fff !important;
  font-size: 1rem !important;
  margin: 0 !important;
}

header h1 a {
  color: #ddd;
}

header h1 a:hover {
  color: #fff;
}

    /* switch wrapper */
.theme-switch{
  display:inline-flex;
  align-items:center;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

/* hide the native checkbox but keep it accessible */
.theme-switch input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}

/* the short scroll bar (track) */
.switch-track{
  width:44px;     /* short bar */
  height:24px;
  background:#ddd;
  border-radius:999px;
  padding:2px;
  box-sizing:border-box;
  display:inline-block;
  transition:background .2s ease;
}

/* the round button (thumb) */
.switch-thumb{
  width:20px;
  height:20px;
  border-radius:50%;
  background:#005ea6;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
  display:block;
  transform:translateX(0);
  transition:transform .2s ease;
}

/* when checked: bar darkens, knob slides right */
.theme-switch input:checked + .switch-track{
  background:#4a5568; /* or any accent you like */
}
.theme-switch input:checked + .switch-track .switch-thumb{
  transform:translateX(20px);
}

/* dark-mode contrast tweak (optional) */
.dark-mode .switch-track{ background:#555; }
.dark-mode .switch-thumb{ background:#005ea6; }

/* keyboard focus ring */
.theme-switch input:focus-visible + .switch-track{
  outline:2px solid #0a84ff;
  outline-offset:2px;
}

.main-nav {
  background: #222;
}

.mobile-nav-toggle {
  display: none;
  background: #444;
  color: #fff;
  border: none;
  padding: 12px;
  width: 100%;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 8px;
}

.main-nav ul li a {
  color: #fff !important;
  margin: 4px 10px;
  padding: 10px;
  font-size: 1rem !important;
}

.main-nav ul li a:hover {
  text-decoration: none;
}



/* ====== Calendar block (used in single page sidebar content) ====== */
.calendar {
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.calendar-header button {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  margin:0 .5rem;
}

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

.calendar-grid span {
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}

.calendar-grid span:hover {
  background: #f0f0f0;
}

.calendar-grid .day {
  color: #333;
}

.calendar-grid .current-day {
  background: #0066cc;
  color: #fff;
}

.calendar-grid .empty,
.calendar-grid .day.disabled {
  color: #bbb;
  cursor: not-allowed;
}

body.dark-mode .calendar {
  background: #222;
}

body.dark-mode .calendar-grid .day {
  color: #fff;
}

body.dark-mode .calendar-grid span:hover {
  background: #333;
}

body.dark-mode .calendar-grid .current-day {
  background: #66b3ff;
}

/* Reset for elements used in the script */
.art-title, .post-excerpt, .author-box, .post-image, .post-text, .post-meta, .related-posts, .sidebar, .backtolist {
    margin: 15px;
    padding: 0;
    box-sizing: border-box;
}

/* Container for main content and sidebar */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Main content */
.post-content {
  font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.art-title {
    font-family: "Nunito Sans", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.4;
}

body.dark-mode .art-title {color:#eee;}

.post-excerpt {
    font-size: 1.1rem;
    font-style: italic;
    color: #555;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    padding-left: 1rem;
}

.author-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f3eded;
    border-radius: 8px;
}

.author-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.author-archive {
    font-size: 0.9rem;
    color: #005ea6;
    text-decoration: none;
    font-weight: 500;
}

.author-archive:hover {
    text-decoration: underline;
}

.post-image {
    margin-bottom: 1.5rem;
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.featured_caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    text-align: center;
}

.post-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-text p {
    margin-bottom: 1rem;
}

.post-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}


.post-text ul {
  margin: 10px 0px;
}

.post-text ul li {
  font-size: 1.2rem;
  margin: 5px 0px;
}

.post-text ol {
  margin: 10px 0px;
}

.post-text ol li {
  font-size: 1.2rem;
  margin: 5px 0px;
}

.post-text div,
.post-text span {
  margin-bottom: 15px;
  font-size: 1.2rem;
  color: #333;
}



body.dark-mode .post-text, body.dark-mode .featured_caption {background:#222;color:#eee;}




/* Meta section */
.post-meta {
    font-size: 0.9rem;
    color: #666;
    margin: 1.5rem 0;
    padding: 0.7rem 0 1rem 1rem;
   border-bottom: 1px solid #e0e0e0;
}

.post-meta a {
    color: #005ea6;
    text-decoration: none;
}

body.dark-mode .post-meta {color:#eee;}
body.dark-mode .post-meta a {color:#eee;}
.post-meta a:hover {
    text-decoration: underline;
}

/* Related posts */
.related-posts {
    margin-top: 2rem;
}

.related-posts h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.related-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
}

.related-card img{
  display:block;
  width:100%;
  aspect-ratio: 16/9;
  height:auto;
  object-fit: cover;
  object-position: 50% 50%;   /* center by default */
}

/* mobile: taller ratio + shift focus upward */
@media (max-width: 768px){
  .related-card img{
    aspect-ratio: 4/3;        /* taller = less aggressive crop */
    object-position: 50% 10%;  /* move viewport up (20% from top) */
  }
}

.related-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0.5rem;
    line-height: 1.4;
}

.related-card a {
    color: #1a1a1a;
    text-decoration: none;
}

.related-card a:hover {
    color: #005ea6;
}


body.dark-mode .related-card {background:#222;}
body.dark-mode .related-card a {color:#eee;}

/* Sidebar */
.sidebar {
    font-size: 0.9rem;
    color: #333;
    text-align: center;           /* center text & inline elements */
    display: flex;
  flex-direction: column;
  align-items: center;        /* center block-level children */
  gap: 1.5rem;
  text-align: center;         /* you already had this; keep it */
}

.sidebar > * {
  width: min(100%, 360px);    /* tweak 360px as you like */
  margin-inline: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     width: min(100%, 360px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.sidebar *,
.sidebar-section * {
  float: none !important;
}

/* Clear any floats that arrive wrapped */
.sidebar::after,
.sidebar-section::after {
  content: "";
  display: block;
  clear: both;
}


.block_heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    border-bottom: 2px solid #005ea6;
    padding-bottom: 0.5rem;
}


.news_list {
    list-style: none;
}

.news_list li {
    margin-bottom: 0.75rem;
}

.news_list a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.news_list a:hover {
    color: #005ea6;
    text-decoration: underline;
}

/* ==========
   Columnist
   ========== */
.columnist {
  width: 100%;
  padding: 10px;
  margin-bottom: 1.5rem;                 /* unified spacing */
  background: #f3eded;
  border: 1px solid #ccc;                /* removed !important */
  border-radius: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Headline */
.columnist h2 {
  width: 100%;
  margin: 6px 0 .5rem;                   /* merge: kept top 6px, added bottom rhythm */
  line-height: 1.35;
  font-size: 1.1rem;                     /* unified at the larger value */
  font-weight: 600;
  color: #1a1a1a;
}

.columnist h2 a {
  color: #1a1a1a;                        /* unified link color */
  font-weight: 600;
  text-decoration: none;
}

.columnist h2 a:hover {
  color: #005ea6;                        /* unified hover color */
}

/* Text */
.columnist p {
  font-size: 0.9rem;
  color: #333;
}

.columnist p b {
  font-size: .95rem;
  color: #333;
  width: 100%;
  text-align: center;
}

.columnist p a {
  color: #005ea6;                        /* unified link color in text */
  text-decoration: none;
}

.columnist p a:hover {
  text-decoration: underline;
}

/* Images */
.columnist img {
  width: 60px;                           /* default image size */
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

/* Larger, explicit author avatar variant */
.columnist .author-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
}


body.dark-mode .sidebar-section, body.dark-mode .columnist {background:#444;}
body.dark-mode .columnist h2 a, body.dark-mode .columnist p b, body.dark-mode .columnist p a, body.dark-mode .block_heading, body.dark-mode .calendar-header, body.dark-mode .weekday {color:#eee;}
/* Back to list link */
.backtolist {
    position: absolute;
    left: 20px;
    top: 30px;
    z-index: 10;
}

.backtolist a {
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    text-decoration: none;
}

.backtolist a:hover {
    color: #ccc;
}

/* Success message box (from the script's output) */
div[style*="width: 300px"] {
    max-width: 100%;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
}

div[style*="width: 300px"] img {
    width: 60px;
    margin: 0 auto 1rem;
}

div[style*="width: 300px"] p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

div[style*="width: 300px"] a {
    color: #005ea6;
    text-decoration: none;
    font-weight: 600;
}

div[style*="width: 300px"] a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .art-title {
        font-size: 2rem;
    }

    .post-excerpt {
        font-size: 1rem;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
    }

    .author-photo {
        width: 200px;
        height: 200px;
    }

    .post-image img {
        max-height: 300px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .related-card img {
        height: 150px;
    }

}

body.dark-mode blockquote > footer {
  color: #bbb;
}

.imgcenter,
.imgleft,
.imgright {
  display: flow-root;
}

.imgcenter {
  text-align: center;
  margin: 18px auto;
  max-width: 100%;
}

.imgcenter img {
  margin: 0 auto;
  width: 100%;
  max-width: 800px;
  height: auto;
  object-fit: cover;
}

.imgleft {
  float: left;
  margin: 10px 15px 10px 0;
  max-width: 300px;
}

.imgleft img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
}

.imgright {
  float: right;
  margin: 10px 0 10px 15px;
  max-width: 300px;
}

.imgright img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
}


blockquote {
  position: relative;
  line-height: 1.7;
  padding: 10px;
  margin: 1px;
  background: #eee;
  border-left: 5px solid #0217b5;
  font-style: italic;
  color: #555;
  font-weight: bold;
  }

blockquote > footer {
  display: block;
  font-style: normal;
  font-weight: bold;
  color: #333;
  text-align: right;
  background: none;
  padding: 0;
  font-size:1rem;
}

.imgright figcaption, .imgleft figcaption, .imgcenter figcaption {width:100%; text-align:center;font-size:.9rem;}

.imgleft + blockquote,
.imgright + blockquote {
  width: calc(100% - 330px);
  clear: none;
}

.imgleft + blockquote {
  float: right;
  margin-left: 5px;
}

.imgright + blockquote {
  float: left;
  margin-right: 5px;
}

.post-text blockquote {
  clear: both;
}

.video-center {
  text-align: center;
  margin: 18px auto;
  max-width: 100%;
}

.video-center iframe {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

.instagram-center {
  text-align: center;
  margin: 18px auto;
  max-width: 100%;
}

.instagram-center iframe {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 658px;
  height: auto;
  border: 0;
}

.mostread-section {
  align-self: stretch;         /* fill the sidebar column */
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: left;            /* override .sidebar { text-align:center } */
  display: block;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  padding: 1rem;
}

/* Heading */
.mostread-section .block_heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #005ea6;
  padding-bottom: 0.5rem;
  text-align:center;
}

/* Tabs */
.mostread-section .tabs { margin-top: .25rem; }

.mostread-section .tab-buttons {
  display: flex;
  gap: .5rem;
  justify-content: flex-start; /* keep buttons left */
  margin-bottom: .75rem;
}

.mostread-section .tab-buttons button {
  appearance: none;
  border: 1px solid #ddd;
  background: #f7f7f7;
  padding: .4rem .65rem;
  border-radius: 6px;
  font-size:1rem;
  cursor: pointer;
}

.mostread-section .tab-buttons button.active {
  background: linear-gradient(135deg, #444, #555);
  color: #fff;
  border-color: #005ea6;
  font-size:1rem;
}

/* Tab content visibility (works with your 'active' class) */
.mostread-section .tab-content { display: none; }
.mostread-section .tab-content.active { display: block; }

/* List */
.mostread-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mostread-section li {
  padding: .7rem 0;
  margin:.3rem 0;
  border-bottom: 1px solid #eee;
}

.mostread-section li:last-child { border-bottom: 0; }

.mostread-section a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  display: block;              /* easier to tap on mobile */
  line-height: 1.35;
}

.mostread-section a:hover {
  color: #005ea6;
 }

/* Optional: clamp long titles to 2 lines */
.mostread-section li a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .sidebar > .mostread-section { padding: .85rem; }
  .mostread-section .tab-buttons { gap: .4rem; }
  .mostread-section .tab-buttons button { padding: .35rem .55rem; }
}

body.dark-mode .mostread-section {background:#444;}
body.dark-mode .mostread-section .tab-buttons button {background:#333;color:#eee;}
body.dark-mode .mostread-section .block_heading, body.dark-mode .mostread-section li a {color:#eee;}



/* "More news" button under Related Posts */
.related-posts .more-news-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  margin: 1rem auto 0;        /* centers under the grid */
  border-radius: 10px;
  border: 1px solid transparent;
  background: #005ea6;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.related-posts .more-news-btn:hover {
  background: #004c8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

.related-posts .more-news-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.related-posts .more-news-btn:focus-visible {
  outline: 2px solid #66b3ff;
  outline-offset: 2px;
}

/* Arrow hint */
.related-posts .more-news-btn::after {
  content: "→";
  transform: translateX(0);
  transition: transform .15s ease;
}

.related-posts .more-news-btn:hover::after {
  transform: translateX(3px);
}

/* Mobile: full-width tap target */
@media (max-width: 768px) {
  .related-posts .more-news-btn {
    width: 100%;
  }
}

.section-header-wrap {width:100%;text-align:center;}
.section-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem .3rem;
  margin: .3rem 0 1rem 0;        /* centers under the grid */
  border-radius: 10px;
  border: 1px solid transparent;
  background: #005ea6;
  color: #fff;
  font-weight: 600;
  font-size:1.2rem;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.section-header:hover {
  background: #004c8f;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

.section-header:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.section-header:focus-visible {
  outline: 2px solid #66b3ff;
  outline-offset: 2px;
}

@media (max-width: 768px) {
.section-header {
    width: 100%;
  }
}

.site-header {
  width: 100%;
  max-width: 1200px;
  margin: 15px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background: #fff;
  border-radius: .5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  position: relative;
  z-index: 20;
}

body.dark-mode .site-header {background:#777;}

/* Logo */

.site-header .logo {margin-right:20px;}

.site-header .logo img {
  width: 150px;
  height: 25px;
  object-fit: contain;
  display: block;
}


@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
    align-items: center;   /* centers horizontally */
    gap: .75rem;
    margin-top:10px;
  }

  .site-header .logo {
    margin: 0 auto;        /* ensure it’s centered */
  }

  .site-header .logo img {
    display: block;
    margin: 0 auto;
  }
}


/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Links */
.nav-links {
  display: flex;
  gap: 1rem;
}
.nav-links a {
  color: #222;
  font-weight: 500;
  font-size: .95rem;
}
.nav-links a:hover { color: #555; }

body.dark-mode .nav-links a {color:#eee;}

/* Search */
.search-form { display: flex; align-items: center; }
.search-form input[type="text"]{
  padding: .35rem .6rem;
  border: 1px solid #ccc;
  border-radius: .35rem 0 0 .35rem;
  font-size: .9rem;
}

@media (max-width: 700px) {
  /* Header container: tighter padding + vertical stack */
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    padding: .6rem .75rem;
  }

  /* Right side becomes a grid so things line up cleanly */
  .nav-right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;   /* left: links/search, right: category button */
    gap: .5rem .75rem;
    align-items: center;
  }

  
  @media (max-width: 700px) {
  /* container */
  .nav-links {
    grid-column: 1 / -1;
    order: 1;
    overflow: hidden;         /* hide overflow for ticker */
    white-space: nowrap;
    position: relative;
  }

  /* moving track: two identical sets inside for a seamless loop */
  .nav-links-track {
    display: inline-flex;
    gap: .75rem;
    will-change: transform;
    transform: translate3d(0,0,0);
    animation: nav-marquee 10s linear infinite;
    animation-delay: 0s;      /* start immediately */
    animation-fill-mode: both;
  }

  /* one set of links */
  .nav-links-set { display: inline-flex; gap: .75rem; }

  .nav-links a {
    font-size: .92rem;
    padding: .35rem 0;
    flex: 0 0 auto;           /* don’t shrink */
  }

  /* marquee keyframes: start in view, no initial wait */
  @keyframes nav-marquee {
    from { transform: translate3d(0%, 0, 0); }     /* first link flush-left at t=0 */
    to   { transform: translate3d(-50%, 0, 0); }   /* half the doubled content */
  }
}
  
  /* Search: full-width row below links */
  .search-form {
    grid-column: 1 / -1;
    order: 2;
    width: 100%;
  }
  .search-form input[type="text"] {
    width: 100%;
    font-size: .92rem;
    padding: .45rem .6rem;
  }
  .search-form button {
    padding: .48rem .6rem;
  }

  /* Categories: show only the 3-line icon on mobile */
  .category-menu {
    order: 3;
    justify-self: end;
  }
  .category-label {
    display: none;
  }
  .category-toggle {
    width: 36px;
    height: 36px;
  }

  /* Dropdown panel fits mobile better */
  .category-panel {
    top: 56px;
    width: 96vw;
    max-height: 75vh;
    border-radius: 10px;
  }
  .chips {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
  }

  /* Keyframes for ticker */
  @keyframes nav-scroll {
    from { transform: translateX(100%); }
    to   { transform: translateX(-100%); }
  }
}

/* Optional: very small phones */
@media (max-width: 360px) {
  .nav-links a { font-size: .88rem; }
}



body.dark-mode .search-form input[type="text"] {background:#777;color:#fff;}
.search-form button{
  border: 1px solid #ccc;
  border-left: none;
  padding: .4rem .6rem;
  background: #ddd; color: #fff;
  border-radius: 0 .35rem .35rem 0;
  cursor: pointer;
}
.search-form button:hover{ background:#444; }

/* ===== Categories (hamburger + label) ===== */
.category-menu { display: flex; align-items: center; gap: .5rem; }
.category-label { font-size: .95rem; color:#222; }

/* SVG hamburger (never renders as a black square) */
.category-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid #ddd;
  border-radius: .4rem;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06) inset;
}
.category-toggle:hover{ background:#f7f7f7; }
.category-toggle svg{ display:block; }

/* ======= Mega dropdown panel ======= */
.category-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 15;
}

/* Panel */
.category-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  top: 64px;                 /* drops below header */
  width: min(1200px, 96vw);
  max-height: 80vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 30;
}

/* Nice soft top fade like your screenshot */
.category-panel::before{
  content:"";
  position: sticky; top: 0;
  display:block; height: 68px;
  background: linear-gradient(180deg, #eaf7ff 0%, #ffffff 100%);
  border-bottom: 1px solid #eef3f6;
}

/* Inner */
.panel-inner{ padding: 1rem 1.25rem 1.5rem; }

/* Close */
.panel-close{
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 22px; line-height: 1;
}

/* Chips grid */
.chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 18px;
  padding-top: 14px;
}
@media (max-width: 1000px){ .chips{ grid-template-columns: repeat(4,1fr);} }
@media (max-width: 760px){  .chips{ grid-template-columns: repeat(3,1fr);} }
@media (max-width: 520px){  .chips{ grid-template-columns: repeat(2,1fr);} }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .9rem;
  background: #fff;
  border: 1px solid #e6ecf0;
  border-radius: 999px;
  color: #222;
  font-size: .95rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.chip:hover{ background:#f3f7fa; }

/* bottom info rows (optional) */
.panel-cols{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
  color:#333;
}
.panel-cols a{ color:#0b66c3;}
.panel-cols a:hover{ text-decoration:underline; }

/* ===== Open state ===== */
.menu-open .category-overlay { opacity: 1; pointer-events: auto; }
.menu-open .category-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.menu-open { overflow: hidden; } /* prevent page scroll while open */

.responsive-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    padding-top: 30px;
    height: 0;
    overflow: hidden;
    margin: 20px 0;
}

.responsive-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}