@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700&family=Playfair+Display+SC:wght@400;700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Karla', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #1a1a1a;
  background: #F5F0EB;
}

/* ===== TOKENS ===== */
:root {
  --red: #E8334A;
  --teal: #1A7A6E;
  --cream: #F5F0EB;
  --dark: #1a1a1a;
  --mid: #4a4a4a;
  --light: #d4cec7;
  --nav-w: 240px;
  --transition: 160ms ease;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ===== LAYOUT WRAPPER ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--nav-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== SIDE NAV ===== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--red);
  margin-bottom: 1.25rem;
}

.nav-brand img {
  flex-shrink: 0;
}

.brand-name,
.brand-name a {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-list li a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: #ccc;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.nav-list li a:hover {
  background: var(--red);
  color: #fff;
}

.nav-list li a[aria-current="page"] {
  background: var(--teal);
  color: #fff;
}

.nav-search {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.nav-search form {
  display: flex;
  gap: 0;
  border: 1px solid #444;
}

.nav-search input {
  flex: 1;
  background: #2a2a2a;
  border: none;
  color: #eee;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  min-height: 40px;
  outline: none;
}

.nav-search input::placeholder {
  color: #888;
}

.nav-search button {
  background: var(--red);
  border: none;
  color: #fff;
  padding: 0 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  transition: background var(--transition);
}

.nav-search button:hover {
  background: #c41f35;
}

/* ===== HERO (HOME) ===== */
.hero {
  display: flex;
  align-items: stretch;
  min-height: 45vh;
  overflow: hidden;
}

.hero-media {
  position: relative;
  flex: 0 0 45%;
  background: var(--teal);
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--teal) 60%, #155f56);
}

.hero-slash {
  position: absolute;
  top: 0;
  right: -40px;
  width: 80px;
  height: 100%;
  background: var(--cream);
  transform: skewX(-6deg);
  z-index: 2;
}

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3rem 3rem 4rem;
  background: var(--cream);
  position: relative;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--mid);
  line-height: 1.7;
  max-width: 38ch;
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 0;
  transition: background var(--transition);
  min-height: 44px;
  align-self: flex-start;
}

.btn-primary:hover {
  background: #c41f35;
}

/* ===== MAIN CONTENT AREA ===== */
#main-content {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 960px;
  width: 100%;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--red);
  display: inline-block;
}

/* ===== HOME CONTENT BODY ===== */
.home-content-body {
  margin-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--mid);
  max-width: 65ch;
}

/* ===== CATEGORY GRID (HOME) ===== */
.home-categories {
  margin-bottom: 3rem;
}

.cat-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.cat-card {
  background: #fff;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 4px solid var(--red);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cat-card-title {
  font-family: 'Playfair Display SC', serif;
  font-size: 1rem;
  font-weight: 700;
}

.cat-card-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition);
}

.cat-card-title a:hover {
  color: var(--red);
}

.cat-card-desc {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.55;
  flex: 1;
}

.cat-card-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  margin-top: 0.5rem;
  transition: color var(--transition);
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
}

.cat-card-link:hover {
  color: var(--red);
}

/* ===== ENTRY STAGGER LIST (HOME) ===== */
.home-entries {
  margin-bottom: 3rem;
}

.entry-stagger {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stagger-item {
  border-bottom: 1px solid var(--light);
  opacity: 0;
  transform: translateY(16px);
  animation: staggerIn 0.35s ease forwards;
}

@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.entry-row {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.entry-row-title {
  font-size: 1rem;
  font-weight: 600;
}

.entry-row-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition);
}

.entry-row-title a:hover {
  color: var(--red);
}

.entry-row-desc {
  font-size: 0.875rem;
  color: var(--mid);
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--mid);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--teal);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ===== CATEGORY PAGE ===== */
.cat-page {
  width: 100%;
}

.cat-header {
  display: flex;
  align-items: stretch;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.cat-header-accent {
  width: 8px;
  background: var(--red);
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.cat-header-text {
  flex: 1;
  padding: 1.5rem 0;
}

.cat-title {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.cat-lead {
  font-size: 1.05rem;
  color: var(--mid);
  max-width: 60ch;
  line-height: 1.7;
}

.cat-body {
  margin-bottom: 3rem;
}

.cat-content-wrap {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--mid);
  max-width: 65ch;
}

.cat-children {
  margin-top: 2rem;
}

.children-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.child-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 4px solid transparent;
  border-bottom-color: var(--light);
  transition: border-bottom-color var(--transition);
}

.child-card:hover {
  border-bottom-color: var(--red);
}

.child-card-num {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
  opacity: 0.4;
  flex-shrink: 0;
  width: 2.5rem;
  text-align: right;
}

.child-card-body {
  flex: 1;
}

.child-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.child-card-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition);
}

.child-card-title a:hover {
  color: var(--red);
}

.child-card-desc {
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.55;
}

.entry-date {
  display: inline-block;
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.3rem;
}

.child-card-arrow {
  color: var(--teal);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.child-card:hover .child-card-arrow {
  transform: translateX(4px);
}

/* ===== ENTRY PAGE ===== */
.entry-page {
  width: 100%;
}

.entry-hero {
  margin-bottom: 2rem;
  overflow: hidden;
}

.entry-hero-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.entry-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--red);
}

.entry-title {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.entry-lead {
  font-size: 1.1rem;
  color: var(--mid);
  line-height: 1.7;
  max-width: 60ch;
  margin-bottom: 1rem;
}

.entry-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.entry-meta-date {
  font-size: 0.82rem;
  color: #888;
}

.entry-body {
  margin-bottom: 3rem;
}

.entry-content-wrap {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--dark);
  max-width: 65ch;
}

.entry-content-wrap h2 {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--dark);
}

.entry-content-wrap h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--teal);
}

.entry-content-wrap p {
  margin-bottom: 1rem;
}

.entry-content-wrap ul,
.entry-content-wrap ol {
  margin: 0 0 1rem 1.5rem;
}

.entry-content-wrap li {
  margin-bottom: 0.4rem;
}

.entry-content-wrap a {
  color: var(--teal);
  text-decoration: underline;
  transition: color var(--transition);
}

.entry-content-wrap a:hover {
  color: var(--red);
}

/* ===== RELATED ===== */
.entry-related {
  background: #fff;
  padding: 1.5rem;
  border-left: 4px solid var(--teal);
  margin-top: 2rem;
}

.related-title {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 1rem;
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-card {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--light);
}

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

.related-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.related-card-title a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition);
}

.related-card-title a:hover {
  color: var(--red);
}

.related-card-desc {
  font-size: 0.83rem;
  color: var(--mid);
}

/* ===== ABOUT PAGE ===== */
.about-page {
  width: 100%;
}

.about-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.about-accent-bar {
  width: 60px;
  height: 6px;
  background: var(--red);
  margin-bottom: 1rem;
}

.about-title {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.about-lead {
  font-size: 1.05rem;
  color: var(--mid);
  max-width: 60ch;
}

.about-hero {
  margin-bottom: 2rem;
}

.about-hero-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  display: block;
}

.about-body {
  margin-bottom: 3rem;
}

.about-content-wrap {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--dark);
  max-width: 65ch;
}

.about-content-wrap h2 {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
}

.about-content-wrap p {
  margin-bottom: 1rem;
}

.about-content-wrap a {
  color: var(--teal);
  text-decoration: underline;
}

.about-nav-cards {
  margin-top: 2rem;
}

.about-nav-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.about-nav-card {
  background: #fff;
  padding: 1.25rem;
  border-bottom: 4px solid var(--teal);
}

.about-nav-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.about-nav-card h3 a {
  color: var(--dark);
  text-decoration: none;
  transition: color var(--transition);
}

.about-nav-card h3 a:hover {
  color: var(--red);
}

.about-nav-card p {
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.5;
}

/* ===== PRIVACY PAGE ===== */
.privacy-page {
  width: 100%;
}

.privacy-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--light);
}

.privacy-title {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.privacy-date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.privacy-lead {
  font-size: 1rem;
  color: var(--mid);
  max-width: 60ch;
}

.privacy-body {
  margin-bottom: 3rem;
}

.privacy-content-wrap {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--dark);
  max-width: 65ch;
}

.privacy-content-wrap h2 {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.privacy-content-wrap p {
  margin-bottom: 1rem;
}

.privacy-content-wrap a {
  color: var(--teal);
  text-decoration: underline;
}

.privacy-footer-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--light);
}

.privacy-footer-links a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
  min-height: 40px;
  line-height: 40px;
}

.privacy-footer-links a:hover {
  color: var(--red);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  color: #ccc;
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding: 3rem 3rem 2rem;
}

.footer-brand {
  font-family: 'Playfair Display SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.footer-about {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #999;
}

.footer-col-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
}

.footer-links a:hover {
  color: var(--cream);
}

.footer-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-form input {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #eee;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  min-height: 40px;
  outline: none;
  border-radius: 0;
}

.footer-form input::placeholder {
  color: #666;
}

.footer-form input:focus {
  border-color: var(--teal);
}

.footer-form button {
  background: var(--red);
  border: none;
  color: #fff;
  padding: 0.6rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  border-radius: 0;
  transition: background var(--transition);
}

.footer-form button:hover {
  background: #c41f35;
}

.footer-email-note {
  font-size: 0.75rem;
  color: #666;
}

.footer-bottom {
  padding: 1rem 3rem;
  border-top: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: #666;
  flex-wrap: wrap;
}

.footer-bottom a {
  color: #888;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-bottom a:hover {
  color: var(--cream);
}

.footer-sep {
  color: #444;
}

/* ===== CONTENT STYLES (shared) ===== */
.cat-content-wrap h2,
.cat-content-wrap h3 {
  font-family: 'Playfair Display SC', serif;
  color: var(--dark);
  margin: 1.5rem 0 0.5rem;
}

.cat-content-wrap h2 { font-size: 1.2rem; }
.cat-content-wrap h3 { font-size: 1rem; color: var(--teal); }

.cat-content-wrap p { margin-bottom: 1rem; }

.cat-content-wrap a {
  color: var(--teal);
  text-decoration: underline;
  transition: color var(--transition);
}

.cat-content-wrap a:hover { color: var(--red); }

.cat-content-wrap ul,
.cat-content-wrap ol {
  margin: 0 0 1rem 1.5rem;
}

.cat-content-wrap li { margin-bottom: 0.4rem; }

/* ===== PARALLAX SCROLL HINT ===== */
@media (prefers-reduced-motion: no-preference) {
  .cat-header-accent {
    transition: height 0.4s ease;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  :root {
    --nav-w: 0px;
  }

  .side-nav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 200;
  }

  .nav-brand {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
    border-right: 2px solid var(--red);
    padding-right: 1rem;
    margin-right: 0.5rem;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex: 1;
  }

  .nav-list li a {
    font-size: 0.8rem;
    padding: 0.45rem 0.75rem;
  }

  .nav-search {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    border-left: 1px solid #333;
    padding-left: 0.75rem;
  }

  .main-content {
    margin-left: 0;
  }

  .page-wrapper {
    flex-direction: column;
  }

  #main-content {
    padding: 1.5rem 1.25rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    padding: 2rem 1.25rem 1.5rem;
  }

  .footer-bottom {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 600px) {
  .hero {
    flex-direction: column;
    min-height: auto;
  }

  .hero-media {
    flex: 0 0 200px;
    height: 200px;
  }

  .hero-slash {
    display: none;
  }

  .hero-text {
    padding: 1.75rem 1.25rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-lead {
    font-size: 0.95rem;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .about-nav-list {
    grid-template-columns: 1fr;
  }

  .child-card-num {
    display: none;
  }

  .entry-meta {
    flex-direction: column;
    gap: 0.3rem;
  }

  .privacy-footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}
