/* Homepage styles extracted from SangaiExpress_Prototype_v11(2).html.
   Shared layout/header/footer styles remain in public.css. */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700;900&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #222222;
  --primary-dark: #3A3A3A;
  --primary-mid: #555555;
  --primary-light: #888888;
  --primary-pale: #CCCCCC;
  --gold: #D4A017;
  --gold-tint: #FFFDF5;
  --gold-border: #E8D580;
  --breaking: #9F3C3B;
  --success: #27AE60;
  --section-national: #222222;
  --section-world: #1A5C8A;
  --section-business: #1A6B3A;
  --section-sport: #7A2B8A;
  --section-science: #1A7A7A;
  --section-opinion: #8A5A1A;
  --bg-page: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-alt: #F5F5F5;
  --bg-image: #E2E5EB;
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  --border-pale: #F5F5F5;
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-faded: #AAAAAA;
  --shadow-card: 0 5px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-fab: 0 4px 16px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.12);
  --font-serif: "Playfair Display", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-mode="dark"] {
  --primary: #E8E8E8;
  --primary-dark: #C8C8C8;
  --primary-mid: #A8A8A8;
  --primary-light: #888888;
  --primary-pale: #444444;
  --gold: #E8A838;
  --gold-tint: #2A2218;
  --gold-border: #5A4818;
  --breaking: #C84844;
  --bg-page: #0F0F0F;
  --bg-card: #1A1A1A;
  --bg-alt: #222222;
  --bg-image: #2A2A2A;
  --border: #3A3A3A;
  --border-light: #2A2A2A;
  --border-pale: #1E1E1E;
  --text-primary: #E8E8E8;
  --text-secondary: #B8B8B8;
  --text-muted: #888888;
  --text-faded: #666666;
  --section-national: #E8E8E8;
  --section-world: #C8C8C8;
  --section-business: #B8B8B8;
  --section-sport: #D0D0D0;
  --section-science: #A8A8A8;
  --section-opinion: #E8A838;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.6), 0 1px 0 rgba(0,0,0,0.8);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

a { color: inherit; text-decoration: none; cursor: pointer; }

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

.page {
    animation: fadeIn 0.3s ease;
}

#page-home {
    display: block;
}
.page.active { display: block; }

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

.hero-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

.hero-carousel.dragging { cursor: grabbing; }

.hero-carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.hero-slide {
  flex: 0 0 100%;
  min-width: 0;
  width: 100%;
}

.hero-dots-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  aspect-ratio: 16/10;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  z-index: 2;
}

.hero-dots {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.hero-dot:hover { background: rgba(255,255,255,0.75); }

.hero-dot.active {
  background: white;
  width: 24px;
  border-radius: 4px;
}

.hero-lead { cursor: pointer; }

.hero-lead-image {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-image);
  border-radius: 2px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.hero-lead-image.style-1 { background-image: linear-gradient(135deg, #4a5a6e 0%, #2a3a4e 100%); }

.hero-lead-image.style-2 { background-image: linear-gradient(135deg, #5e4838 0%, #3a2820 100%); }

.hero-lead-image.style-3 { background-image: linear-gradient(135deg, #485848 0%, #283828 100%); }

.hero-lead-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.3), transparent 50%);
}

.section-tag {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: inline-block;
}

.tag-national { color: var(--section-national); }

.tag-world    { color: var(--section-world); }

.tag-business { color: var(--section-business); }

.tag-sport    { color: var(--section-sport); }

.tag-science  { color: var(--section-science); }

.tag-opinion  { color: var(--section-opinion); }

.tag-breaking { color: var(--breaking); }

.tag-premium  { color: var(--gold); }

.hero-headline {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-deck {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.byline-mini {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
}

.byline-mini strong { color: var(--text-primary); font-weight: 600; }

.hero-secondary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 4px;
}

.secondary-card {
  cursor: pointer;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}

.secondary-card:first-child { padding-top: 0; }

.secondary-card:last-child { border-bottom: none; padding-bottom: 0; }

.secondary-headline {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.22;
  color: var(--text-primary);
  margin-top: 6px;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  transition: color 0.15s ease;
}

.secondary-card:hover .secondary-headline { color: var(--primary-mid); }

.secondary-byline {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.secondary-byline strong { font-weight: 600; }

.secondary-meta { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); }

.section-divider {
  position: relative;
  margin: 32px 0 24px;
  border-top: 2px solid var(--primary);
  height: 24px;
}

.section-divider-label {
  position: absolute;
  top: 2px;
  left: 0;
  background: var(--primary);
  color: var(--bg-card);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 14px;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.story-card { cursor: pointer; transition: transform 0.15s ease; }

.story-card:hover { transform: translateY(-2px); }

.story-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-image);
  border-radius: 2px;
  margin-bottom: 12px;
}

.story-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.story-card-image.style-1 { background-image: linear-gradient(135deg, #4a5870 0%, #2a3850 100%); }

.story-card-image.style-2 { background-image: linear-gradient(135deg, #604838 0%, #382820 100%); }

.story-card-image.style-3 { background-image: linear-gradient(135deg, #485a48 0%, #283828 100%); }

.story-card-image.style-4 { background-image: linear-gradient(135deg, #585060 0%, #302838 100%); }

.story-card-image.style-5 { background-image: linear-gradient(135deg, #506068 0%, #283038 100%); }

.story-card-image.style-6 { background-image: linear-gradient(135deg, #50584a 0%, #2a3028 100%); }

.story-card-headline {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.story-card-meta { font-family: var(--font-ui); font-size: 12px; color: var(--text-muted); }

.btn-ghost-dark {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 10px 28px;
  background: var(--bg-card);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-ghost-dark:hover { background: var(--primary); color: var(--bg-card); }

.load-more-wrap { display: flex; justify-content: center; margin-top: 32px; }

.saved-tab:hover:not(.active) { color: var(--primary); }

.search-filter-btn:hover:not(.active) { color: var(--primary); }

@keyframes listen-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

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

@media (max-width: 900px) {
.hero-grid { grid-template-columns: 1fr; gap: 24px; padding-bottom: 24px; margin-bottom: 24px; }
.hero-secondary { padding-left: 0; padding-top: 4px; border-top: 2px solid var(--primary); }
.secondary-headline { font-size: 18px; }
.hero-headline { font-size: 26px; }
.hero-deck { font-size: 15px; }
.hero-dots-overlay { padding-bottom: 10px; }
.hero-dot { width: 6px; height: 6px; }
.hero-dot.active { width: 20px; }
.story-grid { grid-template-columns: 1fr; gap: 16px; }
}

.settings-pill:not(.active):hover { background: var(--border-light); }

.archive-chip:not(.active):hover { background: var(--border-light); }



/* === HOMEPAGE WIDTH FIX: MATCH PROTOTYPE === */
@media (min-width: 901px) {
    body #mainContent > .container {
        width: 100%;
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
        padding: 28px 32px 80px;
        box-sizing: border-box;
    }

    body #mainContent > .container #page-home {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    body #mainContent > .container #page-home .hero-grid {
        grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
        column-gap: 38px;
        width: 100%;
    }

    body #mainContent > .container #page-home .hero-carousel,
    body #mainContent > .container #page-home .hero-secondary {
        min-width: 0;
        width: 100%;
    }

    body #mainContent > .container #page-home .hero-lead-image {
        width: 100%;
        aspect-ratio: 16 / 10;
    }
}



/* ==========================================
   HERO CAROUSEL - FULL IMAGE
========================================== */

.hero-carousel {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.hero-carousel-track {
    display: flex;
    width: 100%;
    transition: transform 400ms cubic-bezier(.2,.8,.2,1);
    will-change: transform;
}

.hero-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}

/* Show the complete original image */
.hero-lead-image {
    position: relative;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f0ed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-lead-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: center;
}

/* ==========================================
   VERTICAL DOT NAVIGATION - RIGHT SIDE
========================================== */

.hero-dots-overlay {
    position: absolute;
    top: 50%;
    right: 18px;
    left: auto;
    bottom: auto;

    width: auto;
    height: auto;

    transform: translateY(-50%);
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    pointer-events: none;
}

.hero-dots {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: auto;
    height: auto;
    padding: 12px 9px;

    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 30px;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Individual dot */
.hero-dot {
    appearance: none;
    display: block;

    width: 8px;
    height: 8px;
    min-width: 8px;

    padding: 0;
    margin: 0;

    border: 1px solid rgba(255,255,255,.9);
    border-radius: 50%;

    background: rgba(255,255,255,.35);

    cursor: pointer;
    pointer-events: auto;

    transition:
        height 250ms cubic-bezier(.2,.8,.2,1),
        background-color 250ms ease,
        border-color 250ms ease,
        transform 250ms ease;
}

/* Active slide */
.hero-dot.active {
    height: 23px;
    border-radius: 10px;
    background: #fff;
    border-color: #fff;
}

/* Hover */
.hero-dot:hover {
    background: #d5b477;
    border-color: #d5b477;
    transform: scale(1.2);
}

.hero-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Touch devices */
@media (max-width: 600px) {
    .hero-dots-overlay {
        right: 10px;
    }

    .hero-dots {
        gap: 8px;
        padding: 9px 7px;
    }

    .hero-dot {
        width: 7px;
        height: 7px;
        min-width: 7px;
    }

    .hero-dot.active {
        height: 19px;
    }
}

/* Dark mode */
html[data-mode="dark"] .hero-lead-image {
    background: #202020;
}

@media (prefers-reduced-motion: reduce) {
    .hero-carousel-track,
    .hero-dot {
        transition: none;
    }
}
