/*
Theme Name: hipobuy Studio
Theme URI: https://sheetcn.com/
Author: hipobuy Studio Team
Description: An editorial, atelier-inspired SEO WordPress theme for the hipobuy Studio shopping guide. Deep plum + soft apricot + vanilla palette.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: hipobuy-studio
*/

:root {
  --color-bg: #faf5ec;
  --color-surface: #ffffff;
  --color-accent: #6b2168;
  --color-accent-dark: #4a1548;
  --color-accent-2: #f4a582;
  --color-text: #1f1a1e;
  --color-text-muted: #665e62;
  --color-border: #ecd9c7;
  --ff-serif: 'Playfair Display', Georgia, serif;
  --ff-sans: 'Lato', -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(107,33,104,0.08);
  --shadow-hover: 0 10px 32px rgba(107,33,104,0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--ff-serif); color: var(--color-text); line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: 56px; font-weight: 900; font-style: italic; }
h2 { font-size: 32px; font-weight: 700; }
h3 { font-size: 22px; font-weight: 700; }
p { margin: 0 0 16px; color: var(--color-text-muted); }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-dark); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* === Announcement bar === */
.announce {
  background: var(--color-accent);
  color: var(--color-bg);
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  letter-spacing: 0.02em;
  font-family: var(--ff-serif);
  font-style: italic;
}

/* === Masthead === */
.masthead {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
  position: relative;
}
.masthead-inner { display: flex; align-items: center; gap: 32px; }
.brand {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 26px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand .tag {
  font-family: var(--ff-sans);
  font-style: normal;
  font-size: 13px;
  color: var(--color-accent-2);
  font-weight: 500;
}

.nav { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  padding: 6px 2px;
}
.nav a:hover, .nav a.active { color: var(--color-accent); }
.nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--color-accent);
}
.nav .dropdown { position: relative; }
.nav .dropdown > a::after { content: ' ▾'; font-size: 10px; opacity: 0.6; }
.nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-width: 260px;
  padding: 10px 0;
  box-shadow: var(--shadow);
  z-index: 50;
}
.nav .dropdown:hover .dropdown-menu,
.nav .dropdown:focus-within .dropdown-menu { display: block; }
.nav .dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--color-text);
}
.nav .dropdown-menu a:hover { background: rgba(244,165,130,0.15); color: var(--color-accent); }

.cta-group { display: flex; gap: 12px; align-items: center; }
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-dark); color: #fff; }
.btn-secondary {
  background: var(--color-accent-2);
  color: var(--color-text);
  border-color: var(--color-accent-2);
}
.btn-secondary:hover { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover { background: var(--color-accent); color: #fff; }

/* Mobile hamburger */
.mob-toggle { display: none; }
.mob-btn { display: none; cursor: pointer; font-size: 24px; color: var(--color-text); background: none; border: 0; margin-left: auto; }

@media (max-width: 900px) {
  .mob-btn { display: block; }
  .nav { display: none; }
  .mob-toggle:checked ~ .nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-surface);
    padding: 20px;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    z-index: 40;
  }
  .nav .dropdown-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 16px; }
  .cta-group { flex-direction: column; width: 100%; }
  .btn { width: 100%; text-align: center; }
}

/* === HERO (robust) === */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(250,245,236,0.78) 0%, rgba(250,245,236,0.55) 50%, rgba(107,33,104,0.35) 100%);
  z-index: -1;
}
.hero-content {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px;
  z-index: 1;
  text-align: center;
}
.hero .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 16px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.hero h1 {
  color: var(--color-text);
  font-size: 56px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 20px;
}
.hero .lede {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}
.hero .cta-group { justify-content: center; }

@media (max-width: 700px) {
  .hero { min-height: 480px; }
  .hero h1 { font-size: 36px; }
  .hero .lede { font-size: 16px; }
}

/* === Section wrappers === */
.section { padding: 72px 0; }
.section-title { text-align: center; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--color-text-muted); max-width: 600px; margin: 0 auto 48px; }

/* === Category montage: 3 large tiles row 1, 5 compact tiles row 2 === */
.cat-montage { display: grid; gap: 20px; }
.cat-row-large { grid-template-columns: repeat(3, 1fr); display: grid; gap: 20px; }
.cat-row-compact { grid-template-columns: repeat(5, 1fr); display: grid; gap: 16px; margin-top: 20px; }

.cat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
  min-height: 180px;
}
.cat-card.large { padding: 48px 24px; min-height: 240px; }
.cat-card.compact { padding: 24px 14px; min-height: 160px; }
.cat-card:hover {
  background: linear-gradient(135deg, #ffffff 0%, rgba(244,165,130,0.18) 100%);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.cat-card .emoji { font-size: 44px; margin-bottom: 12px; display: block; }
.cat-card.large .emoji { font-size: 56px; }
.cat-card .desc {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.cat-card .name {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
}
.cat-card.large .name { font-size: 18px; }
.cat-card .shop {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  color: var(--color-accent);
  font-weight: 700;
}

@media (max-width: 900px) {
  .cat-row-large, .cat-row-compact { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .cat-row-large, .cat-row-compact { grid-template-columns: 1fr; }
}

/* === Homepage article === */
.home-article {
  background: var(--color-surface);
  padding: 56px 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-width: 920px;
  margin: 0 auto;
}
.home-article h2 { color: var(--color-accent); margin-top: 32px; }
.home-article h2:first-child { margin-top: 0; }
.home-article h3 { color: var(--color-text); font-size: 20px; margin-top: 24px; }
.home-article p { color: var(--color-text); margin-bottom: 18px; }
.home-article ul { padding-left: 22px; color: var(--color-text); }
.home-article li { margin-bottom: 8px; }
.home-article blockquote {
  border-left: 4px solid var(--color-accent-2);
  padding: 8px 20px;
  margin: 24px 0;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-text);
}

@media (max-width: 700px) {
  .home-article { padding: 32px 24px; }
}

/* === Atelier article cards === */
.studies-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.study-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0 24px 24px;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  padding-top: 32px;
}
.study-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  background: var(--color-accent);
}
.study-card::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent-2);
  border: 2px solid var(--color-surface);
}
.study-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.study-card .study-eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 14px;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.study-card h3 { color: var(--color-text); font-size: 20px; margin-bottom: 10px; }
.study-card p { color: var(--color-text-muted); font-size: 15px; margin-bottom: 16px; }
.study-card .open {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 900px) { .studies-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .studies-grid { grid-template-columns: 1fr; } }

/* === CTA strip === */
.cta-strip {
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 72px 24px;
  text-align: center;
}
.cta-strip .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent-2);
  margin-bottom: 16px;
  font-size: 16px;
}
.cta-strip h2 {
  color: var(--color-bg);
  font-size: 36px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 28px;
}
.cta-strip .cta-group { justify-content: center; }
.cta-strip .btn-primary { background: var(--color-accent-2); color: var(--color-text); }
.cta-strip .btn-primary:hover { background: #fff; }
.cta-strip .btn-outline { color: var(--color-bg); border-color: var(--color-bg); }
.cta-strip .btn-outline:hover { background: var(--color-bg); color: var(--color-accent); }

/* === Footer === */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 56px 0 20px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-col h4 {
  color: var(--color-accent-2);
  font-family: var(--ff-serif);
  font-style: italic;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--color-bg); font-size: 14px; opacity: 0.85; }
.footer-col a:hover { color: var(--color-accent-2); opacity: 1; }
.footer-col p { color: rgba(250,245,236,0.75); font-size: 14px; }
.footer-bottom {
  border-top: 1px solid rgba(250,245,236,0.15);
  padding-top: 20px;
  text-align: center;
  color: rgba(250,245,236,0.6);
  font-size: 13px;
}

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

/* === Breadcrumb === */
.breadcrumb {
  padding: 24px 0;
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--ff-serif);
  font-style: italic;
}
.breadcrumb a { color: var(--color-accent); }
.breadcrumb .sep { margin: 0 10px; color: var(--color-accent-2); }

/* === Guide page title band === */
.guide-title-band {
  text-align: center;
  padding: 32px 20px 48px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.guide-title-band .study-eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 15px;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.guide-title-band h1 { font-size: 42px; margin-bottom: 18px; }
.guide-title-band::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--color-accent-2);
  margin: 20px auto 0;
}

/* === Two column with sidebar === */
.content-wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; align-items: start; }
.content-wrap .main-content {
  background: var(--color-surface);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.content-wrap .main-content h2 { color: var(--color-accent); margin-top: 32px; font-size: 26px; }
.content-wrap .main-content h2:first-child { margin-top: 0; }
.content-wrap .main-content p { color: var(--color-text); margin-bottom: 16px; }
.content-wrap .main-content ul { color: var(--color-text); padding-left: 22px; }
.content-wrap .main-content blockquote {
  border-left: 4px solid var(--color-accent-2);
  padding: 8px 20px;
  margin: 24px 0;
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-text);
}
.content-wrap .main-content a { font-weight: 700; }

.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 20px; }
.sidebar-box {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.sidebar-box h3 {
  color: var(--color-accent);
  font-size: 17px;
  margin-bottom: 16px;
  font-family: var(--ff-serif);
  font-style: italic;
  letter-spacing: 0.03em;
}
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { margin-bottom: 10px; }
.sidebar-box a { color: var(--color-text); font-size: 14px; }
.sidebar-box a:hover { color: var(--color-accent); }
.sidebar-box.cta-box { background: var(--color-accent); }
.sidebar-box.cta-box h3 { color: var(--color-accent-2); }
.sidebar-box.cta-box .btn { width: 100%; text-align: center; margin-bottom: 8px; }

@media (max-width: 900px) {
  .content-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .content-wrap .main-content { padding: 32px 24px; }
}

/* === Related guides === */
.related {
  margin-top: 56px;
}
.related h2 {
  text-align: center;
  color: var(--color-accent);
  font-style: italic;
  margin-bottom: 32px;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .related-grid { grid-template-columns: 1fr; } }

/* === Accessibility focus rings === */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Dark mode === */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #15101a;
    --color-surface: #221a2a;
    --color-accent: #a450a0;
    --color-accent-dark: #c374bf;
    --color-accent-2: #f8c4a3;
    --color-text: #f0e7dd;
    --color-text-muted: #a8a0a5;
    --color-border: #3a2e3d;
  }
  .hero-overlay {
    background: linear-gradient(135deg, rgba(21,16,26,0.80) 0%, rgba(21,16,26,0.60) 50%, rgba(164,80,160,0.35) 100%);
  }
  .cat-card:hover {
    background: linear-gradient(135deg, var(--color-surface) 0%, rgba(248,196,163,0.12) 100%);
  }
  .cta-strip .btn-primary { background: var(--color-accent-2); color: var(--color-text); }
  .cta-strip .btn-outline { color: var(--color-text); border-color: var(--color-text); }
  .cta-strip .btn-outline:hover { background: var(--color-text); color: var(--color-accent); }
}
