/* ==========================================================================
   Rest of Words - Complete Editorial Stylesheet
   Modeled after restofworld.org design system
   ========================================================================== */

@charset "UTF-8";

/* --- Google Fonts & Font Stacks --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;1,6..72,400&display=swap');

:root {
  --white: #ffffff;
  --black: #000000;
  --charcoal: #111111;
  --basalt: #262626;
  --ash: #555555;
  --pumice: #cacaca;
  --light-gray: #f4f4f4;
  --border-color: #e5e5e5;
  
  --body: #ffffff;
  --text-main: #000000;
  --text-secondary: #555555;
  --text-serif: #262626;
  --primary: #242EF7;
  --primary-hover: #1720c7;
  --secondary-dark: #0B2566;
  --secondary-light: #E4F3F7;
  --accent: #FFBEF0;
  --yellow: #fff9c0;
  
  --masthead-height: 56px;
  --font-sans: 'Inter', Moderat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Input Mono', SFMono-Regular, Consolas, monospace;
}

@media (min-width: 992px) {
  :root {
    --masthead-height: 63px;
  }
}

/* --- Dark Mode Variables --- */
body.dark-mode {
  --body: #111111;
  --text-main: #f0f0f0;
  --text-secondary: #aaaaaa;
  --text-serif: #dddddd;
  --light-gray: #1a1a1a;
  --border-color: #2e2e2e;
  --pumice: #444444;
  --secondary-light: #162438;
  --secondary-dark: #051336;
}

/* --- CSS Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--body);
  transition: background-color 150ms ease-out, color 150ms ease-out;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border-radius: 0;
}

button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.skip-link:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  padding: 15px 23px;
  position: absolute;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* --- Layout Wrapper --- */
.site-wrapper {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

main.main {
  display: block;
  padding: 30px 0 60px;
  min-height: calc(100vh - var(--masthead-height) - 200px);
}

/* ==========================================================================
   Header & Masthead
   ========================================================================== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--body);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.masthead-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
}

@media (min-width: 992px) {
  .masthead-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
  }
}

.masthead-left {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-start;
}

.masthead-links {
  display: none;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

@media (min-width: 1100px) {
  .masthead-links {
    display: flex;
  }
}

.masthead-links li a,
.masthead-links a {
  color: var(--text-main);
  transition: color 0.15s ease;
}

.masthead-links a:hover {
  color: var(--primary);
}

.masthead-categories {
  display: none;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (min-width: 992px) {
  .masthead-categories {
    display: block;
  }
}

.masthead-categories__links {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.masthead-categories__links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s ease;
}

.masthead-categories__links a:hover {
  color: var(--primary);
}

/* Center Logo Branding */
.masthead-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 0 0 auto;
}

.masthead-branding__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 2.6rem;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-main);
  border: none;
  max-width: var(--logo-max-width-mobile, 180px);
}

.masthead-branding__logo img,
.custom-logo-link img {
  max-width: var(--logo-max-width-mobile, 180px);
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (min-width: 992px) {
  .masthead-branding__logo {
    max-width: var(--logo-max-width, 240px);
    font-size: 3rem;
  }
  .masthead-branding__logo img,
  .custom-logo-link img {
    max-width: var(--logo-max-width, 240px);
    width: 100%;
    height: auto;
  }
}

.masthead-right {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-end;
}

.masthead-navigation {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Search and CTA in Header */
.search--collapsible.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-icon:hover {
  color: var(--primary);
}

.search--collapsible .search-form {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  width: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  background: var(--body);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  padding: 2px 4px;
  z-index: 10;
  display: flex;
}

.search--collapsible.search--active .search-form {
  opacity: 1;
  visibility: visible;
  width: 220px;
  pointer-events: auto;
}

.search-form__field {
  flex: 1;
}

.search-form__field input {
  padding: 6px 10px;
  font-size: 1.3rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.search-form__submit {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 5px 12px;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
}

.masthead-navigation__cta .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  background: var(--body);
  color: var(--text-main);
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all 0.15s ease;
}

.masthead-navigation__cta .button:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.masthead-navigation__cta .button svg {
  width: 12px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
}

.masthead-navigation__open {
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
}

.masthead-navigation__open svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-main);
}

.masthead-navigation__open:hover svg {
  stroke: var(--primary);
}

/* ==========================================================================
   Hamburger Slide-out Drawer Navigation
   ========================================================================== */
.nav__background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

html.nav-open .nav__background {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--body);
  z-index: 2000;
  transform: translateX(100%);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease, opacity 0.3s ease;
  overflow-y: auto;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
  padding: 24px 30px 50px;
}

html.nav-open .nav {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 25px;
}

.nav-header__close {
  padding: 8px;
}

.nav-header__close svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-main);
  stroke-width: 2;
}

.nav-header__links {
  display: flex;
  gap: 15px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
}

.meta-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.meta-header__text {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-right: 12px;
}

.meta-header__rule {
  flex: 1;
  height: 1px;
  background: var(--primary);
}

.nav-main__section {
  margin-bottom: 30px;
}

.nav-menu--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.nav-menu--grid li a {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.nav-menu--grid li a:hover {
  color: var(--primary);
}

/* Dark Mode Switcher in Nav */
.dm-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-transform: uppercase;
  background: var(--light-gray);
}

.dm-select__slider {
  display: flex;
  gap: 8px;
}

.dm-select svg {
  width: 16px;
  height: 16px;
  fill: var(--text-main);
}

/* ==========================================================================
   Homepage & Editorial Segments Layout
   ========================================================================== */
.block--group--latest-stories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 50px;
}

@media (min-width: 992px) {
  .block--group--latest-stories {
    grid-template-columns: 320px 1fr;
    gap: 40px;
  }
}

/* Sidebar: Latest Stories */
.latest {
  border-right: none;
  padding-right: 0;
}

@media (min-width: 992px) {
  .latest--left {
    border-right: 1px solid var(--border-color);
    padding-right: 30px;
  }
}

.latest-header {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.latest-header .kicker a {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.latest-content__container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.latest-story {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.latest-story:last-child {
  border-bottom: none;
}

.latest-story__hed {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--text-main);
}

.latest-story:hover .latest-story__hed {
  color: var(--primary);
}

.latest-story__meta {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.latest-link {
  margin-top: 25px;
}

.latest-link a {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.latest-link a:hover {
  text-decoration: underline;
}

/* Top Curated Collection (Hero Segment) */
.curated-collection {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.curated-collection__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding-bottom: 35px;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
  .curated-collection__row--3 {
    grid-template-columns: 1.4fr 1fr;
  }
  .curated-collection__row--reverse {
    grid-template-columns: 1fr 1.4fr;
  }
}

.cc-sub-column {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.cc-story {
  display: flex;
  flex-direction: column;
}

.cc-story__image {
  margin-bottom: 14px;
  overflow: hidden;
  background-color: var(--light-gray);
  border-radius: 2px;
}

.cc-story__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cc-story:hover .cc-story__image img {
  transform: scale(1.02);
}

.kicker, .rubric {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.kicker a, .rubric a {
  color: var(--primary);
}

.headline {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0 0 8px;
}

.hed-xl {
  font-size: 3.2rem;
}
.hed-lg {
  font-size: 2.4rem;
}
.hed-md {
  font-size: 2.0rem;
}
.hed-sm {
  font-size: 1.7rem;
}

.dek, .dek p {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  line-height: 1.4;
  color: var(--text-serif);
  margin: 0 0 10px;
}

.byline {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.byline a {
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   Newsletter Subscription Banner ("A world of tech in your inbox")
   ========================================================================== */
.block--homepage-newsletter {
  background: var(--secondary-light);
  border-radius: 4px;
  padding: 40px 30px;
  margin: 50px 0;
  position: relative;
  overflow: hidden;
}

body.dark-mode .block--homepage-newsletter {
  background: var(--secondary-light);
}

.hp-nl__container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hp-nl__container {
    grid-template-columns: 1.3fr 0.7fr;
  }
}

.hp-nl__headline {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--secondary-dark);
  margin: 0 0 12px;
}

body.dark-mode .hp-nl__headline {
  color: #8bb5ff;
}

.hp-nl__dek {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1.4;
  color: var(--text-serif);
  margin: 0 0 25px;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.newsletter-form__field {
  flex: 1 1 200px;
}

.newsletter-form__field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  background: var(--body);
  color: var(--text-main);
  font-size: 1.5rem;
}

.newsletter-form__submit input {
  padding: 12px 24px;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.newsletter-form__submit input:hover {
  background: var(--primary-hover);
}

.newsletter-form__submit__success {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: #107c41;
  font-weight: 700;
  margin-top: 8px;
}

/* ==========================================================================
   Spotlight & Category Segments (The AI Race >, EV Revolution >, etc.)
   ========================================================================== */
.block--spotlight {
  margin: 50px 0;
}

.spotlight-header {
  border-top: 2px solid var(--primary);
  padding-top: 12px;
  margin-bottom: 24px;
}

.spotlight-header__title {
  font-size: 2.6rem;
  font-weight: 800;
}

.spotlight-header__title a {
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spotlight-header__title a:hover {
  color: var(--primary);
}

.spotlight-content--row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

@media (min-width: 600px) {
  .spotlight-content--row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .spotlight-content--row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.spotlight-story {
  display: flex;
  flex-direction: column;
}

.spotlight-story__image {
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--light-gray);
  border-radius: 2px;
}

.spotlight-story__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.spotlight-story:hover .headline {
  color: var(--primary);
}

/* ==========================================================================
   Popular Stories Carousel / Grid
   ========================================================================== */
.block--popular {
  background: var(--primary);
  color: var(--white);
  padding: 40px 25px;
  border-radius: 4px;
  margin: 60px 0;
}

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

.popular-title {
  font-family: var(--font-sans);
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--accent);
  margin: 0;
}

.popular-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

@media (min-width: 600px) {
  .popular-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .popular-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.popular-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
  overflow: hidden;
}

.popular-card__number {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.4);
  padding: 14px 16px 0;
}

.popular-card__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.popular-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.popular-card__body .headline {
  color: var(--white);
  font-size: 1.8rem;
}

.popular-card__body .byline {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

/* ==========================================================================
   Section List (7-8 Categories Horizontal Multi-Grid)
   ========================================================================== */
.block--section-list {
  margin: 60px 0;
}

.sl__wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 600px) {
  .sl__wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .sl__wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sl__container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 2px solid var(--primary);
  padding-top: 14px;
}

.sl__vertical a {
  font-family: var(--font-sans);
  font-size: 2.0rem;
  font-weight: 800;
  color: var(--text-main);
}

.sl__vertical a:hover {
  color: var(--primary);
}

.sl__article {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sl__article:last-child {
  border-bottom: none;
}

.sl__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 2px;
}

.sl__headline {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.sl__headline:hover {
  color: var(--primary);
}

/* ==========================================================================
   Latest Stories Page Layout (`page-latest.php`) & 3-Grid
   ========================================================================== */
.archive-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 20px;
  margin-bottom: 35px;
}

.archive-header__title {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.sharing-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-icon, .social-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--text-main);
}

.share-icon svg, .social-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.share-icon:hover, .social-icon:hover {
  background: var(--primary);
  color: var(--white);
}

.articles--block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .articles--block {
    grid-template-columns: 1.4fr 1fr;
  }
}

.articles--narrow {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 30px;
}

.article-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 600px) {
  .article-row {
    grid-template-columns: 240px 1fr;
  }
}

.article-row__image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
}

/* Pagination */
.posts-navigation {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 50px 0 20px;
}

.posts-navigation a, .posts-navigation span {
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.posts-navigation span.current {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ==========================================================================
   Single Post Reading Experience & Right Sidebar
   ========================================================================== */
.single-post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-top: 20px;
}

@media (min-width: 992px) {
  .single-post-layout {
    grid-template-columns: 1fr 340px;
    gap: 50px;
  }
}

.post-header {
  margin-bottom: 30px;
}

.post-kicker {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 10px;
}

.post-title {
  font-size: 3.6rem;
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 16px;
}

@media (min-width: 768px) {
  .post-title {
    font-size: 4.8rem;
  }
}

.post-dek {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1.4;
  color: var(--text-serif);
  margin-bottom: 25px;
}

/* Author Profile Card in Post Header/Side */
.post-author-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.post-author-avatar img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.post-author-info {
  flex: 1;
}

.post-author-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.post-author-bio {
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.post-date-meta {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Featured Image full width */
.post-featured-image {
  margin: 25px 0 35px;
  border-radius: 3px;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  max-height: 650px;
  object-fit: cover;
}

/* Post Content Typography */
.post-content p {
  font-family: var(--font-serif);
  font-size: 2.0rem;
  line-height: 1.65;
  color: var(--text-serif);
  margin-bottom: 1.5em;
}

.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  margin: 40px 0 15px;
}

.post-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 24px;
  margin: 35px 0;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--primary);
  line-height: 1.3;
}

/* Single Post Right Sidebar */
.single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.sidebar-nav-post {
  padding: 16px 20px;
  background: var(--light-gray);
  border-left: 3px solid var(--primary);
  border-radius: 2px;
}

.sidebar-nav-label {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.sidebar-nav-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

/* Quote Box Treatment in Sidebar */
.sidebar-quote-box {
  background: var(--secondary-light);
  border: 1px solid var(--border-color);
  padding: 24px 20px;
  border-radius: 4px;
  position: relative;
}

body.dark-mode .sidebar-quote-box {
  background: #141f33;
}

.sidebar-quote-box::before {
  content: '“';
  font-family: var(--font-serif);
  font-size: 6rem;
  line-height: 1;
  color: var(--primary);
  position: absolute;
  top: 10px;
  left: 15px;
  opacity: 0.3;
}

.sidebar-quote-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.sidebar-quote-author {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.sidebar-quote-role {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Single Post Sidebar Slot & Featured + Text Feeds */
.single-sidebar-slot {
  display: flex;
  flex-direction: column;
  gap: 45px;
}

/* Floating / Sticky Sidebar (Sidebar Melayang) */
@media (min-width: 1024px) {
  .single-sidebar.has-sticky-slot .single-sidebar-slot.is-sticky {
    position: sticky;
    top: 85px;
    z-index: 10;
    align-self: flex-start;
  }
}

.single-sidebar-widget {
  margin-bottom: 45px;
  padding-bottom: 10px;
}

.single-sidebar-widget:last-child {
  margin-bottom: 0;
}

.sidebar-posts-block {
  margin-bottom: 0;
}

/* Prominent Editorial Sidebar Heading Treatment */
.sidebar-section-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.single-sidebar-widget .widget-title,
.sidebar-section-title {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sidebar-section-title .mono {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  margin-left: 6px;
}

/* Sidebar Interactive Tabs */
.sidebar-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.sidebar-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.sidebar-tab-btn:hover {
  color: var(--primary);
  background: rgba(36, 46, 247, 0.05);
}

.sidebar-tab-btn.active {
  color: var(--primary);
  background: var(--light-gray);
  box-shadow: inset 0 -2px 0 var(--primary);
}

body.dark-mode .sidebar-tab-btn.active {
  background: #1a2538;
}

.sidebar-tab-panel {
  animation: fadeInTab 0.25s ease-in-out;
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Featured Card (Post #1 in Sidebar Feed) */
.sidebar-featured-card {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-featured-card__image-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 12px;
  background: var(--light-gray);
}

.sidebar-featured-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.sidebar-featured-card:hover .sidebar-featured-card__img {
  transform: scale(1.03);
}

.sidebar-featured-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-featured-card__rubric,
.sidebar-text-item__rubric {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.sidebar-featured-card__rubric a,
.sidebar-text-item__rubric a {
  color: var(--primary);
  text-decoration: none;
}

.sidebar-featured-card__title {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin: 0 0 8px;
  transition: color 0.15s ease;
}

.sidebar-featured-card__title-link:hover .sidebar-featured-card__title,
.sidebar-text-item__title-link:hover .sidebar-text-item__title {
  color: var(--primary);
}

.sidebar-featured-card__meta,
.sidebar-text-item__meta {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--ash);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Text List Items (Posts #2+ in Sidebar Feed) */
.sidebar-feed-posts {
  display: flex;
  flex-direction: column;
}

.sidebar-text-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-text-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-text-item__title {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin: 0 0 6px;
  transition: color 0.15s ease;
}

.sidebar-no-posts {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--ash);
  padding: 12px 0;
}

/* ==========================================================================
   Footer Recirc Block (Read More Stories in Single Post)
   ========================================================================== */
.footer-recirc {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 3px solid var(--primary);
}

.footer-recirc__header {
  font-family: var(--font-sans);
  font-size: 2.8rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-main);
}

.footer-recirc__stories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .footer-recirc__stories {
    grid-template-columns: repeat(3, 1fr);
  }
}

.recirc-story {
  display: flex;
  flex-direction: column;
}

.recirc-story__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 12px;
  background: var(--light-gray);
}

.recirc-story__headline {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 6px 0;
  color: var(--text-main);
}

.recirc-story:hover .recirc-story__headline {
  color: var(--primary);
}

.recirc-story__dek {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--text-serif);
  margin-bottom: 10px;
}

.recirc-story__author {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer (All Blue Background #242EF7)
   ========================================================================== */
.footer {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-top: none;
  padding: 60px 0 70px;
  margin-top: 60px;
  text-align: center;
}

.footer-branding {
  margin-bottom: 25px;
}

.footer-branding__logo {
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  color: #ffffff !important;
  display: inline-block;
  max-width: var(--logo-max-width, 240px);
}

.footer-branding__logo .site-title-text {
  color: #ffffff !important;
}

.footer-branding__logo img,
.footer .custom-logo-link img {
  margin: 0 auto;
  max-width: var(--logo-max-width, 240px);
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.footer-social {
  margin-bottom: 30px;
}

.footer-social .social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-social .social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.footer-social .social-icon:hover {
  background: #ffffff;
  color: var(--primary) !important;
  border-color: #ffffff;
  transform: translateY(-2px);
}

.footer-social .social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.footer-menu {
  margin-bottom: 25px;
}

.footer-menu .menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px 25px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  text-transform: uppercase;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu .menu a {
  color: rgba(255, 255, 255, 0.9) !important;
  transition: color 0.15s ease;
}

.footer-menu .menu a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* =======================================================
   1. JARAK ANTAR WIDGET (Pengganti <br><br>)
======================================================= */
.single-sidebar-widget {
    margin-bottom: 40px; /* Ubah angka ini untuk mengatur jarak antar widget */
}
/* Menghilangkan jarak berlebih di widget paling bawah */
.single-sidebar-widget:last-child {
    margin-bottom: 0; 
}

/* =======================================================
   2. UKURAN JUDUL
======================================================= */
/* Judul Utama Widget (misal: "Latest Stories") */
.sidebar-section-title {
    font-size: 24px; /* Sesuaikan ukurannya */
    font-weight: bold;
    margin-bottom: 15px; 
}

/* Judul Artikel (Featured dan Text biasa) */
.sidebar-featured-card__title,
.sidebar-text-item__title {
    font-size: 18px; /* Judul artikel lebih besar */
    line-height: 1.4;
    margin-bottom: 8px; /* Jarak antara judul dan tanggal */
}

/* =======================================================
   3. UKURAN TANGGAL & META
======================================================= */
.sidebar-featured-card__meta,
.sidebar-text-item__meta {
    font-size: 12px; /* Ukuran tanggal menjadi lebih kecil */
    color: #666666; /* Warna sedikit redup agar judul lebih menonjol */
}

/* =======================================================
   4. JARAK ANTAR LIST ARTIKEL
======================================================= */
/* Menggunakan Flexbox Gap (Cara paling rapi dan modern) */
.sidebar-feed-posts,
.sidebar-feed-container {
    display: flex;
    flex-direction: column;
    gap: 24px; /* Ubah angka ini untuk mengatur jarak antar artikel */
}