/* Tide Digest - Theme Stylesheet (Weather & Disaster Preparedness for Vietnamese Families) */
:root {
  --font-base: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --color-primary: #0f2b46;
  --color-primary-light: #1b4570;
  --color-accent: #d97706;
  --color-accent-hover: #b45309;
  --color-teal: #0284c7;
  --color-teal-dark: #0369a1;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-subtle: #f1f5f9;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-subtle: #cbd5e1;
  --color-warning-bg: #fef3c7;
  --color-warning-border: #fcd34d;
  --color-warning-text: #92400e;
  --color-info-bg: #e0f2fe;
  --color-info-border: #bae6fd;
  --color-info-text: #0369a1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 43, 70, 0.06), 0 1px 2px rgba(15, 43, 70, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 43, 70, 0.08), 0 2px 4px -2px rgba(15, 43, 70, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 43, 70, 0.1), 0 4px 6px -4px rgba(15, 43, 70, 0.05);
  --max-w: 1160px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: var(--color-teal);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--color-accent);
  color: #ffffff;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 9999;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid #ffffff;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Top advisory ticker */
.top-advisory {
  background: var(--color-primary);
  color: #e2e8f0;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 0;
}
.top-advisory .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.advisory-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(217, 119, 6, 0.25);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.advisory-source {
  color: #94a3b8;
  font-size: 0.8rem;
}
.advisory-source a {
  color: #38bdf8;
  text-decoration: underline;
}

/* Site header & nav */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-primary);
}
.brand-link:hover {
  text-decoration: none;
}
.brand-logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--color-primary);
}
.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}
.nav-link {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-teal);
  text-decoration: none;
  border-bottom-color: var(--color-teal);
}
.nav-cta {
  background: var(--color-accent);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

/* Mobile nav toggle using details/summary (CSS only, no JS) */
.mobile-nav-details {
  display: none;
}
.mobile-nav-summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  background: var(--color-surface-subtle);
  user-select: none;
}
.mobile-nav-summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }
  .mobile-nav-details {
    display: block;
    position: relative;
  }
  .mobile-nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 200;
  }
  .mobile-nav-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mobile-nav-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }
  .mobile-nav-menu a:hover {
    background: var(--color-surface-subtle);
    color: var(--color-teal);
    text-decoration: none;
  }
  .mobile-nav-menu .nav-cta {
    margin-top: 8px;
    text-align: center;
  }
}

/* Main Content Area */
main {
  flex: 1;
}

/* Section styling */
.section {
  padding: 40px 0;
}
.section-subtle {
  background: var(--color-surface-subtle);
}
.section-title-wrap {
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.section-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
  align-items: stretch;
  margin-top: 24px;
  margin-bottom: 36px;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-feature-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.hero-feature-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0f2b46;
}
.hero-feature-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.category-pill {
  display: inline-block;
  background: var(--color-info-bg);
  color: var(--color-info-text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  margin-bottom: 12px;
}
.category-pill.amber {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.hero-feature-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-primary);
  margin-bottom: 10px;
}
.hero-feature-title a {
  color: var(--color-primary);
}
.hero-feature-title a:hover {
  color: var(--color-teal);
  text-decoration: none;
}
.hero-feature-excerpt {
  color: var(--color-text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}
.article-meta {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}

/* Hero Emergency Hotline & Checklist Card */
.emergency-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.emergency-header {
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.emergency-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hotline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.hotline-item {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.hotline-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1.1;
}
.hotline-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.2;
}

.guideline-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}
.guideline-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}
.guideline-box ul {
  list-style: disc;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.5;
}
.guideline-box li {
  margin-bottom: 4px;
}

.source-banner {
  background: var(--color-surface-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.source-banner strong {
  color: var(--color-primary);
}

/* Card Grid for Articles */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 960px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.article-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-primary);
}
.article-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.article-card-title a {
  color: var(--color-primary);
}
.article-card-title a:hover {
  color: var(--color-teal);
  text-decoration: none;
}
.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.55;
  margin-bottom: 14px;
  flex: 1;
}

/* Quick checklist banner on Home */
.quick-checklist-band {
  background: var(--color-primary);
  color: #ffffff;
  padding: 36px 0;
  margin-top: 40px;
}
.quick-checklist-band .section-title {
  color: #ffffff;
}
.checklist-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 900px) {
  .checklist-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .checklist-columns {
    grid-template-columns: 1fr;
  }
}
.checklist-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 18px;
}
.checklist-item-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 6px;
}
.checklist-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}
.checklist-item-text {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Article Page Layout */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.breadcrumbs {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumbs span {
  color: #94a3b8;
}
.article-header {
  margin-bottom: 24px;
}
.article-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  margin: 12px 0;
}
@media (max-width: 600px) {
  .article-title {
    font-size: 1.65rem;
  }
}
.article-standfirst {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.65;
  color: #334155;
  border-left: 3px solid var(--color-teal);
  padding-left: 16px;
  margin-top: 14px;
  margin-bottom: 20px;
  background: var(--color-surface-subtle);
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.article-byline-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Article Hero Figure */
.article-figure {
  margin: 24px 0 32px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-caption {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  background: var(--color-surface-subtle);
  border-top: 1px solid var(--color-border);
  line-height: 1.45;
}
.article-caption a {
  color: var(--color-teal);
}

/* Article Prose Typography */
.prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #1e293b;
}
.prose p {
  margin-bottom: 1.35rem;
}
.prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.35;
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
  letter-spacing: -0.3px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.prose h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e3a5f;
  margin-top: 1.6rem;
  margin-bottom: 0.7rem;
}
.prose ul, .prose ol {
  margin-bottom: 1.4rem;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 0.5rem;
}
.prose blockquote {
  border-left: 4px solid var(--color-accent);
  background: #fffbeb;
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.6rem 0;
  font-style: normal;
  color: #78350f;
  font-size: 0.98rem;
}

/* Callout boxes inside prose */
.callout-box {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 1.6rem 0;
  font-size: 0.95rem;
  line-height: 1.65;
}
.callout-box.info {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: #0c4a6e;
}
.callout-box.warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: #78350f;
}
.callout-box strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

/* Comparison / Reference Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.6rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}
table.data-table th, table.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}
table.data-table th {
  background: var(--color-surface-subtle);
  font-weight: 700;
  color: var(--color-primary);
}
table.data-table tr:last-child td {
  border-bottom: none;
}
table.data-table tr:hover {
  background: rgba(241, 245, 249, 0.5);
}

/* Author Box */
.author-box {
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 40px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.author-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.author-info p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Related articles on post page */
.related-posts-section {
  border-top: 2px solid var(--color-border);
  margin-top: 50px;
  padding-top: 36px;
}
.related-posts-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
}

/* Static Page Content (About, Contact, Write for us) */
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}
.page-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 20px;
}
.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
}
.page-lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.6;
}

.static-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.static-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

/* Contact Form UI (CSS only / mailto) */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.btn-primary:hover {
  background: var(--color-primary-light);
  color: #ffffff;
  text-decoration: none;
}

/* 404 Page */
.error-page {
  text-align: center;
  padding: 80px 20px;
  max-width: 600px;
  margin: 0 auto;
}
.error-code {
  font-size: 5rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -2px;
}
.error-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 16px 0 10px;
}
.error-text {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--color-primary);
  color: #cbd5e1;
  padding: 48px 0 24px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 32px;
  margin-bottom: 36px;
}
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-col a {
  color: #94a3b8;
  transition: color 0.15s ease;
}
.footer-col a:hover {
  color: #38bdf8;
  text-decoration: none;
}
.footer-about p {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 10px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #64748b;
}

/* Helper utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
