/* ============================================================
   Beauty Theme — Modern IG Editorial
   Refs: Byrdie.com / Into The Gloss / @skincare IG aesthetic
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Variables ── */
[data-theme="beauty"] {
  /* ─ Beauty palette ─ */
  --color-primary:        #B76E79;
  --color-primary-dk:     #8E4D57;
  --color-accent:         #D4A5A5;
  --color-accent-lt:      #F5E6E8;
  --color-bg:             #FDFAF8;
  --color-bg-alt:         #F7F0F1;
  --color-text:           #2C1218;
  --color-muted:          #9E6B72;
  --color-border:         #ECD5D8;

  --font-display:         'Playfair Display', Georgia, serif;
  --font-ui:              'DM Sans', system-ui, sans-serif;

  --radius:               2px;
  --shadow-card:          0 2px 16px rgba(183,110,121,0.08);
  --shadow-hover:         0 6px 32px rgba(183,110,121,0.15);
  --transition:           0.35s ease;

  /* ─ Bridge variables (template shared styles expect these) ─ */
  --color-surface:        #FDFAF8;
  --color-primary-dark:   #2C1218;
  --color-primary-light:  #C98B94;
  --color-accent-light:   #F5E6E8;
  --color-text-primary:   #2C1218;
  --color-text-secondary: #5A3038;
  --color-text-muted:     #9E6B72;
  --color-text-on-dark:   #FDFAF8;

  --font-heading:         'Playfair Display', Georgia, serif;
  --font-body:            'DM Sans', system-ui, sans-serif;

  --radius-sm:            2px;
  --radius-md:            4px;
  --radius-lg:            8px;

  --header-bg:            #2C1218;
  --header-text:          #FDFAF8;
  --footer-bg:            #2C1218;
  --footer-text:          #D4A5A5;

  --card-shadow:          0 2px 16px rgba(183,110,121,0.08);
  --card-shadow-hover:    0 6px 32px rgba(183,110,121,0.15);
  --reading-progress-color: #B76E79;
}

/* ── Header ── */
[data-theme="beauty"] .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition);
}

[data-theme="beauty"] .site-header.scrolled {
  background: rgba(253, 250, 248, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--color-border);
}

/* Header inner layout */
[data-theme="beauty"] .header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 1.5rem 0;
}

[data-theme="beauty"] .header-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.6rem;
}

[data-theme="beauty"] .header-logo {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--color-text);
  text-decoration: none;
  position: static;
  transform: none;
}

[data-theme="beauty"] .header-nav {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 0.65rem 0 0.75rem;
  border-top: 1px solid var(--color-border);
  width: 100%;
}

[data-theme="beauty"] .header-nav a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
}

[data-theme="beauty"] .header-nav a:hover {
  color: var(--color-primary);
}

/* 手機版：縮小字距，保持一行 */
@media (max-width: 480px) {
  [data-theme="beauty"] .header-logo {
    font-size: 1.45rem;
    text-transform: none;
  }
  [data-theme="beauty"] .header-nav {
    gap: 1.5rem;
  }
  [data-theme="beauty"] .header-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
  }
}

/* ── Hero：無封面圖 ── */
[data-theme="beauty"] .hero-no-image {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg-alt);
}

[data-theme="beauty"] .hero-no-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 18% 55%, rgba(183,110,121,0.17) 0%, transparent 65%),
    radial-gradient(ellipse 60% 75% at 82% 22%, rgba(212,165,165,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 52% 85%, rgba(245,230,232,0.5) 0%, transparent 55%);
  pointer-events: none;
}

[data-theme="beauty"] .hero-no-image::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(183,110,121,0.11);
  top: -130px;
  right: -110px;
  pointer-events: none;
}

[data-theme="beauty"] .hero-circle-deco {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(183,110,121,0.08);
  bottom: -90px;
  left: 4%;
  box-shadow:
    0 0 0 50px rgba(183,110,121,0.03),
    0 0 0 100px rgba(183,110,121,0.02);
  pointer-events: none;
}

[data-theme="beauty"] .hero-text-center {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
}

[data-theme="beauty"] .hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
}

[data-theme="beauty"] .hero-no-image h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

[data-theme="beauty"] .hero-stat {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

/* ── Hero：有封面圖 ── */
[data-theme="beauty"] .hero-with-image {
  position: relative;
  height: 88vh;
  min-height: 560px;
  overflow: hidden;
}

[data-theme="beauty"] .hero-with-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

[data-theme="beauty"] .hero-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(44,18,24,0.72) 0%,
    rgba(44,18,24,0.24) 45%,
    transparent 100%
  );
}

[data-theme="beauty"] .hero-img-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3.5rem 4rem;
}

[data-theme="beauty"] .hero-img-content .hero-eyebrow {
  color: rgba(253,250,248,0.7);
}

[data-theme="beauty"] .hero-img-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 400;
  font-style: italic;
  color: #FDFAF8;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

[data-theme="beauty"] .hero-img-content .hero-stat {
  color: rgba(253,250,248,0.65);
}

/* ── Article Cards ── */
[data-theme="beauty"] .article-card {
  display: block;
  text-decoration: none;
  background: var(--color-bg);
  border: 0.5px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

[data-theme="beauty"] .article-card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

[data-theme="beauty"] .card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
}

[data-theme="beauty"] .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s ease;
}

[data-theme="beauty"] .article-card:hover .card-img-wrap img {
  transform: scale(1.045);
}

/* 分類 pill 壓在圖上 */
[data-theme="beauty"] .card-category-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(253,250,248,0.22);
  color: #FDFAF8;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

/* 無封面圖佔位 */
[data-theme="beauty"] .card-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-accent-lt) 0%, var(--color-bg-alt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="beauty"] .card-img-placeholder::after {
  content: '';
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(183,110,121,0.22);
  box-shadow: 0 0 0 14px rgba(183,110,121,0.06);
}

[data-theme="beauty"] .card-body {
  padding: 1rem 0;
}

[data-theme="beauty"] .card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

[data-theme="beauty"] .card-excerpt {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-muted);
}

[data-theme="beauty"] .card-date {
  font-family: var(--font-ui);
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-top: 0.85rem;
}

/* Magazine：第一篇大圖全寬 */
[data-theme="beauty"] .articles-grid.magazine .article-card:first-child {
  grid-column: 1 / -1;
}

[data-theme="beauty"] .articles-grid.magazine .article-card:first-child .card-img-wrap {
  aspect-ratio: 16 / 7;
}

[data-theme="beauty"] .articles-grid.magazine .article-card:first-child .card-title {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

/* ── Section 標題 ── */
[data-theme="beauty"] .section-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 0.75rem;
}

[data-theme="beauty"] .section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-text);
  text-align: center;
}

[data-theme="beauty"] .section-rule {
  width: 32px;
  height: 1px;
  background: var(--color-primary);
  margin: 1.25rem auto 3rem;
}

/* ── Stats bar ── */
[data-theme="beauty"] .stats-bar {
  background: var(--color-primary);
  padding: 3.5rem 2rem;
}

[data-theme="beauty"] .stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 400;
  font-style: italic;
  color: #FDFAF8;
  line-height: 1;
}

[data-theme="beauty"] .stat-label {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(253,250,248,0.62);
  margin-top: 0.5rem;
}

/* ── Footer ── */
[data-theme="beauty"] .site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 4rem 2rem 3rem;
}

[data-theme="beauty"] .footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--color-text);
  text-decoration: none;
  display: inline-block;
}

[data-theme="beauty"] .footer-rule {
  width: 28px;
  height: 1px;
  background: var(--color-primary);
  margin: 0.85rem auto 1.75rem;
}

[data-theme="beauty"] .footer-nav a {
  font-family: var(--font-ui);
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transition: color var(--transition);
}

[data-theme="beauty"] .footer-nav a:hover {
  color: var(--color-primary);
}

[data-theme="beauty"] .footer-copy {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  opacity: 0.6;
}

/* ── Article Page ── */
[data-theme="beauty"] .article-hero-no-img {
  height: 260px;
  position: relative;
  overflow: hidden;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="beauty"] .article-hero-no-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 25% 50%, rgba(183,110,121,0.16) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 78% 30%, rgba(212,165,165,0.2) 0%, transparent 55%);
  pointer-events: none;
}

[data-theme="beauty"] .article-hero-with-img {
  height: 480px;
  position: relative;
  overflow: hidden;
}

[data-theme="beauty"] .article-hero-with-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-theme="beauty"] .article-hero-with-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,18,24,0.55) 0%, transparent 55%);
}

[data-theme="beauty"] .article-body {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.9;
  color: var(--color-text);
}

[data-theme="beauty"] .article-body h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  font-style: italic;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

[data-theme="beauty"] .article-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* ── Reading progress ── */
[data-theme="beauty"] .reading-progress-bar {
  background: var(--color-primary);
  height: 2px;
}

/* ── Breadcrumb ── */
[data-theme="beauty"] .breadcrumb,
[data-theme="beauty"] .breadcrumb a {
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
}

[data-theme="beauty"] .breadcrumb a:hover {
  color: var(--color-primary);
}

/* ── Category Cards (beauty override) ── */
[data-theme="beauty"] .cat-card {
  background: var(--color-bg) !important;
  border-color: var(--color-border) !important;
}

/* 深色 hover：文字全部改淺色 */
[data-theme="beauty"] .cat-card:hover {
  background: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

[data-theme="beauty"] .cat-card:hover .cat-card-number {
  color: rgba(183,110,121,0.45) !important;
}

[data-theme="beauty"] .cat-card:hover .cat-card-name {
  color: #FDFAF8 !important;
}

[data-theme="beauty"] .cat-card:hover .cat-card-count {
  color: rgba(253,250,248,0.55) !important;
}

[data-theme="beauty"] .cat-card:hover .cat-card-arrow {
  color: var(--color-accent) !important;
}

/* 靜態狀態：確保正常可讀 */
[data-theme="beauty"] .cat-card .cat-card-number {
  color: var(--color-accent) !important;
}

[data-theme="beauty"] .cat-card .cat-card-name {
  color: var(--color-text) !important;
}

[data-theme="beauty"] .cat-card .cat-card-count {
  color: var(--color-muted) !important;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  [data-theme="beauty"] .hero-no-image { min-height: 55vh; }
  [data-theme="beauty"] .hero-with-image { height: 62vh; min-height: 400px; }
  [data-theme="beauty"] .hero-img-content { padding: 2rem; }
  [data-theme="beauty"] .header-nav { display: flex !important; }
  [data-theme="beauty"] .header-logo {
    font-size: 1.65rem;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.06em;
    text-transform: none;
  }
  [data-theme="beauty"] .header-nav a {
    font-size: 0.78rem;
  }
  [data-theme="beauty"] .stats-bar .grid { grid-template-columns: 1fr 1fr; }

  /* P1 rule: prevent orb/glow overflow */
  html, body { overflow-x: hidden; }
}
