/* editorial-warmth — 2019 Magazine/Editorial Design System */

/* ===== CSS Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "Nunito Sans", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  color: #3d2b1f;
  background-color: #fdf8f0;
  -webkit-font-smoothing: antialiased;
}

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

input, button, textarea, select {
  font: inherit;
}

a {
  color: #b8860b;
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

a:hover {
  color: #c85a32;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Cormorant Garamond", "Noto Serif TC", serif;
  color: #2c1810;
  font-weight: 600;
  line-height: 1.25;
}

/* ===== Design Tokens ===== */
:root {
  --bg-cream: #fdf8f0;
  --heading-brown: #2c1810;
  --accent-terracotta: #c85a32;
  --link-gold: #b8860b;
  --secondary-sage: #7a9e7e;
  --text-body: #3d2b1f;
  --text-muted: #6b5344;
  --border-dashed: #c4a882;
  --sidebar-width: 250px;
  --max-width: 1400px;
  --transition: 0.3s ease;
  --font-heading: "Cormorant Garamond", "Noto Serif TC", serif;
  --font-body: "Nunito Sans", "Noto Sans TC", sans-serif;
}

/* ===== Layout Shell ===== */
.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.layout-editorial {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas: "sidebar main";
  gap: 48px;
  padding: 48px 0 64px;
}

.sidebar-panel {
  grid-area: sidebar;
}

.content-primary {
  grid-area: main;
  min-width: 0;
}

/* ===== Header — Double Layer ===== */
.site-masthead {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-cream);
}

.utility-bar {
  background: #2c1810;
  color: #e8dcc8;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.utility-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.utility-link {
  color: #d4a853;
  margin-left: 8px;
}

.utility-link:hover {
  color: #fff;
}

.main-nav-bar {
  border-bottom: 2px dashed var(--border-dashed);
  background: var(--bg-cream);
}

.main-nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 0;
}

.brand-mark {
  flex-shrink: 0;
}

.brand-serif {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--heading-brown);
  letter-spacing: -0.02em;
}

.brand-link:hover .brand-serif {
  color: var(--accent-terracotta);
}

.primary-navigation {
  flex: 1;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}

.nav-list li {
  display: inline;
}

.nav-list a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--accent-terracotta);
  border-bottom-color: var(--accent-terracotta);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-search {
  display: flex;
  border: 1px dashed var(--border-dashed);
}

.nav-search-input {
  border: none;
  background: transparent;
  padding: 8px 12px;
  width: 140px;
  font-size: 0.82rem;
  color: var(--text-body);
}

.nav-search-input:focus {
  outline: none;
}

.nav-search-btn {
  border: none;
  background: var(--heading-brown);
  color: #fff;
  padding: 8px 14px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.nav-search-btn:hover {
  background: var(--accent-terracotta);
}

.nav-cta-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-terracotta);
  padding: 10px 20px;
  transition: background var(--transition);
}

.nav-cta-link:hover {
  background: var(--heading-brown);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--heading-brown);
  transition: transform var(--transition);
}

/* ===== Hero — 21:9 Editorial ===== */
.main-showcase {
  width: 100%;
}

.hero-editorial {
  position: relative;
  margin: 0;
}

.hero-frame {
  position: relative;
  width: 100%;
}

.hero-image-wrap {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #e8dcc8 0%, #c4a882 50%, #7a9e7e 100%);
}

.hero-image-wrap.hero-fallback {
  background: linear-gradient(135deg, #e8dcc8 0%, #c4a882 50%, #7a9e7e 100%);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-editorial:hover .hero-image {
  transform: scale(1.02);
}

.hero-caption-box {
  position: absolute;
  bottom: 32px;
  left: 32px;
  max-width: 520px;
  background: rgba(253, 248, 240, 0.94);
  border-left: 4px solid var(--accent-terracotta);
  padding: 28px 32px;
  box-shadow: 0 8px 32px rgba(44, 24, 16, 0.12);
}

.hero-kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary-sage);
  margin-bottom: 8px;
}

.hero-headline {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 12px;
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== Buttons ===== */
.btn-editorial {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--heading-brown);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-terracotta);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--heading-brown);
  border-color: var(--heading-brown);
}

.btn-outline:hover {
  background: var(--heading-brown);
  color: #fff;
}

.btn-accent {
  background: var(--accent-terracotta);
  color: #fff;
  width: 100%;
  text-align: center;
}

.btn-accent:hover {
  background: var(--heading-brown);
  color: #fff;
}

/* ===== Sidebar ===== */
.sidebar-block {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px dashed var(--border-dashed);
}

.sidebar-heading {
  font-size: 1.15rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-terracotta);
  display: inline-block;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-links a {
  display: block;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-body);
  border-bottom: 1px dotted var(--border-dashed);
  transition: color var(--transition), padding-left var(--transition);
}

.category-links a:hover,
.category-links a.active {
  color: var(--accent-terracotta);
  padding-left: 8px;
}

.featured-teaser .teaser-image-wrap {
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #e8dcc8, #7a9e7e);
  position: relative;
  margin-bottom: 12px;
}

.featured-teaser .teaser-link {
  display: block;
  width: 100%;
  height: 100%;
}

.category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-terracotta);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
}

.teaser-title {
  font-size: 1.1rem;
}

.teaser-title a {
  color: var(--heading-brown);
  text-decoration: underline;
  text-decoration-color: var(--link-gold);
  text-underline-offset: 4px;
  transition: text-decoration-color var(--transition);
}

.teaser-title a:hover {
  text-decoration-color: var(--accent-terracotta);
  color: var(--accent-terracotta);
}

.teaser-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.contact-cta-box {
  background: #fff;
  border: 2px dashed var(--border-dashed);
  padding: 20px;
}

.cta-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ===== Section Headers ===== */
.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 8px;
}

.section-deck {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Features Mosaic ===== */
.features-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 56px;
}

.features-mosaic .feature-item,
.features-mosaic .feature-card {
  background: #fff;
  border: 1px dashed var(--border-dashed);
  padding: 28px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.features-mosaic .feature-item:hover,
.features-mosaic .feature-card:hover {
  box-shadow: 0 6px 24px rgba(44, 24, 16, 0.08);
  transform: translateY(-3px);
}

.features-mosaic h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.features-mosaic p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.features-mosaic .feature-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
  color: var(--secondary-sage);
}

/* ===== Magazine Grid — Varying Card Sizes ===== */
.magazine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.magazine-grid > [class*="col-"] {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  max-width: 100% !important;
  flex: none !important;
}

.magazine-grid > [class*="col-"]:nth-child(1),
.magazine-grid > [class*="col-"]:nth-child(6) {
  grid-column: span 2;
}

.magazine-grid > [class*="col-"]:nth-child(3) {
  grid-row: span 1;
}

/* Editorial Product Cards */
.product-card {
  background: #fff;
  border: 1px solid rgba(196, 168, 130, 0.4);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
  box-shadow: 0 10px 36px rgba(44, 24, 16, 0.1);
  transform: translateY(-4px);
}

.product-card .card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-img {
  transform: scale(1.04);
}

.product-card .card-body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card .card-body::before {
  content: "精選";
  position: absolute;
  top: -14px;
  left: 20px;
  background: var(--secondary-sage);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
}

.product-card .card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading-brown);
  margin-bottom: 8px;
  text-decoration: underline;
  text-decoration-color: var(--link-gold);
  text-underline-offset: 5px;
  transition: text-decoration-color var(--transition);
}

.product-card:hover .card-title {
  text-decoration-color: var(--accent-terracotta);
}

.product-card .card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.product-card .card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.product-card .card-price {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-terracotta);
  margin-top: auto;
  margin-bottom: 14px;
}

.product-card .card-btn {
  display: block;
  text-align: center;
  padding: 10px 16px;
  background: var(--heading-brown);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background var(--transition);
}

.product-card .card-btn:hover {
  background: var(--accent-terracotta);
  color: #fff;
}

/* ===== Region Filter ===== */
.region-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border-dashed);
}

.region-filter a {
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-body);
  border: 1px dashed var(--border-dashed);
  transition: all var(--transition);
}

.region-filter a:hover,
.region-filter a.active {
  background: var(--heading-brown);
  color: #fff;
  border-color: var(--heading-brown);
}

/* ===== Notices Panel ===== */
.notices-panel {
  background: #fff;
  border-left: 4px solid var(--secondary-sage);
  padding: 24px 28px;
  margin-bottom: 48px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.notices-panel p {
  margin-bottom: 8px;
}

/* ===== Typography — Drop Cap & Pull Quote ===== */
.drop-cap-text > p:first-of-type::first-letter,
.article-prose > p:first-of-type::first-letter,
.product-prose > p:first-of-type::first-letter,
.seo-prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 4.2rem;
  line-height: 0.78;
  font-weight: 700;
  color: var(--accent-terracotta);
  margin: 6px 12px 0 0;
  padding-right: 4px;
}

.seo-prose,
.article-prose,
.product-prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-body);
}

.seo-prose h2,
.seo-prose h3,
.article-prose h2,
.product-prose h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
}

.seo-prose p,
.article-prose p,
.product-prose p {
  margin-bottom: 20px;
}

.pull-quote {
  margin: 40px 0;
  padding: 28px 36px;
  border-top: 2px dashed var(--border-dashed);
  border-bottom: 2px dashed var(--border-dashed);
  text-align: center;
}

.pull-quote p {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--heading-brown);
  line-height: 1.5;
  margin-bottom: 12px;
}

.pull-quote cite {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Breadcrumb ===== */
.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 24px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-trail a {
  color: var(--text-muted);
}

.breadcrumb-trail a:hover {
  color: var(--accent-terracotta);
}

.breadcrumb-sep {
  color: var(--border-dashed);
}

.breadcrumb-current {
  color: var(--heading-brown);
  font-weight: 600;
}

/* ===== Pagination ===== */
.pagination-wrap {
  margin-top: 16px;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination li {
  list-style: none;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
  border: 1px dashed var(--border-dashed);
  transition: all var(--transition);
}

.pagination a:hover,
.pagination li.active a {
  background: var(--heading-brown);
  color: #fff;
  border-color: var(--heading-brown);
}

/* ===== Footer — 3 Column + Bottom Bar ===== */
.site-colophon {
  margin-top: 64px;
  background: #2c1810;
  color: #c4a882;
  font-family: var(--font-heading);
}

.colophon-border {
  height: 4px;
  border-top: 3px dashed #c4a882;
  border-bottom: 1px dashed #6b5344;
}

.colophon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding: 56px 0 40px;
}

.colophon-heading {
  font-size: 1.25rem;
  color: #fdf8f0;
  margin-bottom: 20px;
  font-weight: 600;
}

.colophon-body p {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.8;
  color: #a89070;
}

.colophon-links li {
  margin-bottom: 10px;
}

.colophon-links a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #a89070;
  transition: color var(--transition);
}

.colophon-links a:hover {
  color: #d4a853;
}

.colophon-action {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--accent-terracotta);
  color: #fff !important;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  transition: background var(--transition);
}

.colophon-action:hover {
  background: #d4a853;
  color: #fff !important;
}

.colophon-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px dashed #6b5344;
}

.colophon-copyright {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: #6b5344;
}

.colophon-legal {
  font-family: var(--font-body);
  font-size: 0.78rem;
}

.colophon-legal a {
  color: #a89070;
}

.colophon-legal a:hover {
  color: #d4a853;
}

.colophon-divider {
  margin: 0 8px;
  color: #6b5344;
}

.contact-dynamic {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ===== Article Page ===== */
.article-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px dashed var(--border-dashed);
}

.article-kicker {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary-sage);
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 16px;
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px dashed var(--border-dashed);
}

.related-list li {
  padding: 12px 0;
  border-bottom: 1px dotted var(--border-dashed);
}

.related-list a {
  font-size: 0.95rem;
  color: var(--text-body);
  transition: color var(--transition);
}

.related-list a:hover {
  color: var(--accent-terracotta);
}

.sidebar-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ===== Bootstrap col compatibility ===== */
.text-warning {
  color: #b8860b !important;
}

.row {
  display: contents;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .magazine-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .magazine-grid > [class*="col-"]:nth-child(1),
  .magazine-grid > [class*="col-"]:nth-child(6) {
    grid-column: span 1;
  }
}

@media (max-width: 960px) {
  .layout-editorial {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar";
    gap: 32px;
  }

  .sidebar-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
  }

  .sidebar-block {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-cream);
    border-bottom: 2px dashed var(--border-dashed);
    padding: 16px 28px;
    box-shadow: 0 8px 24px rgba(44, 24, 16, 0.08);
  }

  .nav-panel.is-open {
    display: block;
  }

  .primary-navigation {
    position: relative;
  }

  .nav-list {
    flex-direction: column;
    gap: 12px;
  }

  .nav-search {
    display: none;
  }

  .main-nav-inner {
    flex-wrap: wrap;
  }

  .colophon-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-caption-box {
    position: relative;
    bottom: auto;
    left: auto;
    max-width: 100%;
    margin: -40px 28px 0;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 16px;
  }

  .magazine-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .hero-image-wrap {
    aspect-ratio: 16 / 9;
  }

  .features-mosaic {
    grid-template-columns: 1fr;
  }

  .colophon-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .magazine-grid {
    grid-template-columns: 1fr;
  }

  .nav-actions .nav-cta-link {
    display: none;
  }
}
