/* ============================================================
   The Decor Diary — magazine-style design system
   Palette: cream #faf7f2 · terracotta #c67b5c · espresso #2b2118 · sage #8a9b7e
   Type: Playfair Display (headlines) · Inter / system sans (body)
   ============================================================ */

:root {
  --cream: #faf7f2;
  --cream-deep: #f3ede2;
  --terracotta: #c67b5c;
  --terracotta-dark: #a86244;
  --espresso: #2b2118;
  --espresso-soft: #4a3d30;
  --sage: #8a9b7e;
  --sage-light: #e6ebe0;
  --line: #e7ddcd;
  --white: #ffffff;
  --ink: #2b2118;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 33, 24, 0.08);
  --shadow-hover: 0 16px 40px rgba(43, 33, 24, 0.14);
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--espresso);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; color: var(--espresso); font-weight: 700; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Sticky header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
  font-family: var(--font-head); font-size: 1.55rem; font-weight: 800;
  color: var(--espresso); text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--terracotta); }
.logo:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.site-nav a {
  color: var(--espresso-soft); font-size: 0.92rem; font-weight: 600;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover, .site-nav a.active { background: var(--cream-deep); color: var(--terracotta-dark); text-decoration: none; }
.social-icons { display: flex; align-items: center; gap: 10px; }
.social-icons a {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #f5efe2;
  transition: transform 0.2s, background 0.2s;
}
.social-icons a:hover { background: var(--terracotta); transform: translateY(-2px); text-decoration: none; }
.social-icons svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- Homepage hero ---------- */
.hero-home { padding: 40px 0 8px; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--terracotta-dark); margin-bottom: 14px;
}
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }
.hero-main {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 440px; display: flex; align-items: flex-end;
  box-shadow: var(--shadow); text-decoration: none;
}
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-main:hover img { transform: scale(1.04); }
.hero-main::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 12, 7, 0.82) 0%, rgba(20, 12, 7, 0.25) 55%, transparent 80%);
}
.hero-main-text { position: relative; z-index: 2; padding: 30px; color: #fff; }
.hero-main-text h2 { color: #fff; font-size: 2rem; margin: 10px 0 8px; }
.hero-main-text p { color: rgba(255,255,255,0.85); font-size: 0.98rem; }
.hero-side { display: flex; flex-direction: column; gap: 22px; }
.hero-card {
  position: relative; border-radius: var(--radius); overflow: hidden; flex: 1;
  min-height: 132px; display: flex; align-items: flex-end; box-shadow: var(--shadow); text-decoration: none;
}
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-card:hover img { transform: scale(1.05); }
.hero-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 12, 7, 0.85) 0%, rgba(20, 12, 7, 0.15) 70%, transparent 100%);
}
.hero-card-text { position: relative; z-index: 2; padding: 18px; }
.hero-card-text h3 { color: #fff; font-size: 1.05rem; }

.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #fff; background: var(--terracotta);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 8px;
}
.tag.sage { background: var(--sage); }

/* ---------- Trending strip ---------- */
.trending { margin: 34px auto 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; align-items: center; gap: 18px; }
.trending-inner { display: flex; align-items: center; gap: 26px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%); mask-image: linear-gradient(to right, #000 90%, transparent 100%); }
.trending-inner::-webkit-scrollbar { display: none; }
.trending-inner a { scroll-snap-align: start; }
.trending-label {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--terracotta-dark); white-space: nowrap;
  border-right: 1px solid var(--line); padding-right: 18px;
}
.trending a { color: var(--espresso-soft); font-size: 0.92rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.trending a:hover { color: var(--terracotta-dark); }
.trending a::before { content: "#"; color: var(--sage); font-weight: 800; margin-right: 2px; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 46px 0 22px; }
.section-head h2 { font-size: 1.7rem; }
.section-head a { font-size: 0.9rem; font-weight: 600; }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden; height: 190px;
  display: flex; align-items: flex-end; box-shadow: var(--shadow); text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,12,7,0.78), transparent 65%); }
.cat-card span { position: relative; z-index: 2; color: #fff; font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; padding: 16px 18px; }

/* ---------- Post grid / cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: var(--espresso);
  transition: transform 0.25s, box-shadow 0.25s; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); text-decoration: none; }
.post-card-img { aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card .kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--terracotta-dark); }
.post-card h3 { font-size: 1.18rem; line-height: 1.35; }
.post-card p.excerpt { font-size: 0.92rem; color: var(--espresso-soft); flex: 1; }
.post-card .date { font-size: 0.8rem; color: #9a8c7a; }

/* ---------- Newsletter band ---------- */
.newsletter {
  margin: 60px 0 0; background: var(--ink); color: #f5efe2; border-radius: var(--radius);
  padding: 52px 32px; text-align: center; color: var(--cream);
}
.newsletter h2 { color: #fff; font-size: 1.9rem; margin-bottom: 10px; }
.newsletter p { color: rgba(250, 247, 242, 0.8); max-width: 560px; margin: 0 auto 24px; }
.btn {
  display: inline-block; background: var(--terracotta); color: #fff !important;
  font-weight: 700; padding: 13px 30px; border-radius: 999px; text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--terracotta-dark); transform: translateY(-2px); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; background: var(--ink); color: rgba(250,247,242,0.75); }
.footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 48px 24px 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px;
}
.footer-brand .logo { color: #fff; }
.footer-brand p { font-size: 0.9rem; margin-top: 12px; max-width: 320px; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer ul { list-style: none; }
.site-footer ul a { color: rgba(250,247,242,0.75); font-size: 0.92rem; display: inline-block; padding: 4px 0; text-decoration: none; }
.site-footer ul a:hover { color: var(--terracotta); }
.footer-bottom {
  border-top: 1px solid rgba(250,247,242,0.14); padding: 20px 24px;
  max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.82rem; flex-wrap: wrap;
}

/* ---------- Article page ---------- */
.article-hero-wrap { margin: 26px 0 8px; }
.breadcrumb { font-size: 0.85rem; color: #9a8c7a; margin: 26px 0 14px; }
.breadcrumb a { color: #9a8c7a; text-decoration: none; }
.breadcrumb a:hover { color: var(--terracotta-dark); }
.article-tag {
  display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--terracotta-dark);
  border: 1px solid var(--terracotta); border-radius: 999px; padding: 6px 16px; margin-bottom: 14px;
}
.article h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 12px; }
.article-meta { display: flex; align-items: center; gap: 10px; color: #9a8c7a; font-size: 0.9rem; margin-bottom: 24px; }
.article-meta .dot { opacity: 0.5; }
.article-hero { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.article-hero-caption { font-size: 0.82rem; color: #9a8c7a; margin-top: 8px; font-style: italic; }

.toc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin: 30px 0; box-shadow: var(--shadow);
}
.toc h2 { font-size: 1.15rem; margin-bottom: 10px; font-family: var(--font-body); font-weight: 800; }
.toc ol { margin-left: 20px; }
.toc li { margin: 6px 0; font-size: 0.95rem; }
.toc a { color: var(--espresso-soft); text-decoration: none; }
.toc a:hover { color: var(--terracotta-dark); }

.article-body { font-size: 1.06rem; }
.article-body > p:first-of-type::first-letter {
  font-family: var(--font-head); font-size: 3.4em; float: left;
  line-height: 0.9; padding: 6px 10px 0 0; color: var(--terracotta-dark); font-weight: 700;
}
.article-body h2 { font-size: 1.65rem; margin: 42px 0 14px; padding-top: 8px; }
.article-body h3 { font-size: 1.25rem; margin: 30px 0 10px; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--terracotta-dark); font-weight: 600; }

.pull-quote {
  border-left: 4px solid var(--terracotta); margin: 34px 0; padding: 6px 0 6px 26px;
  font-family: var(--font-head); font-size: 1.35rem; font-style: italic; color: var(--espresso-soft);
}

.product-box {
  background: var(--sage-light); border: 1px solid #d3dcc9; border-radius: var(--radius);
  padding: 24px 28px; margin: 34px 0;
}
.product-box h3 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.product-box p { margin: 0; font-size: 0.98rem; }

.adsense-slot {
  background: var(--cream-deep); border: 1px dashed #c9bda6; border-radius: var(--radius);
  padding: 26px; margin: 34px 0; text-align: center;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: #a89a83;
}

.faq { margin: 44px 0; }
.faq h2 { font-size: 1.65rem; margin-bottom: 16px; }
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-bottom: 12px; }
.faq-item h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; }
.faq-item p { margin: 0; font-size: 0.97rem; color: var(--espresso-soft); }

.author-box {
  display: flex; gap: 18px; align-items: center; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 40px 0;
}
.author-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--terracotta); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 700;
}
.author-box h3 { font-family: var(--font-body); font-size: 1rem; margin-bottom: 4px; }
.author-box p { font-size: 0.92rem; color: var(--espresso-soft); margin: 0; }

.related-posts { margin: 50px 0 10px; }
.related-posts h2 { font-size: 1.6rem; margin-bottom: 20px; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 40px 0 10px; }
.prev-next a {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; text-decoration: none; transition: box-shadow 0.2s, transform 0.2s;
}
.prev-next a:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); text-decoration: none; }
.prev-next .dir { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terracotta-dark); margin-bottom: 4px; }
.prev-next .ttl { font-family: var(--font-head); font-weight: 700; color: var(--espresso); font-size: 1.02rem; }
.prev-next .next { text-align: right; }

/* ---------- Static pages ---------- */
.page { padding: 40px 0 20px; }
.page h1 { font-size: 2.2rem; margin-bottom: 16px; }
.page h2 { font-size: 1.4rem; margin: 30px 0 10px; }
.page p { margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 340px; }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .article h1 { font-size: 2rem; }
}
@media (max-width: 700px) {
  .post-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { flex-wrap: wrap; }
  .social-icons { margin-left: auto; }
  .hero-main-text h2 { font-size: 1.5rem; }
  .prev-next { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .article h1 { font-size: 1.75rem; }
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --cream: #16110c;
  --cream-deep: #1f1811;
  --espresso: #f2e9d6;
  --espresso-soft: #d9cbb2;
  --sage-light: #2c352a;
  --line: #3a2e20;
  --white: #221a11;
  --ink: #0e0a06;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
[data-theme="dark"] .site-header { background: rgba(22, 17, 12, 0.96); }
[data-theme="dark"] input, [data-theme="dark"] textarea {
  background: #241b12; color: var(--espresso); border-color: var(--line);
}
body { transition: background-color 0.3s ease, color 0.3s ease; }

/* ---------- Header buttons: theme toggle + hamburger ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--espresso);
  cursor: pointer; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--terracotta); color: var(--terracotta-dark); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.hamburger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: transparent; cursor: pointer; flex-shrink: 0;
}
.hamburger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--espresso); }

/* ---------- Mobile drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(20, 14, 8, 0.55); z-index: 190;
  opacity: 0; transition: opacity 0.3s ease;
}
.drawer-overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(320px, 85vw);
  background: var(--cream); z-index: 200; transform: translateX(105%);
  transition: transform 0.32s ease; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head .logo { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--espresso); }
.drawer-head .logo span { color: var(--terracotta); }
.drawer-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--espresso); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.drawer-nav { display: flex; flex-direction: column; padding: 12px 0; overflow-y: auto; }
.drawer-nav a {
  padding: 13px 24px; font-weight: 600; color: var(--espresso); font-size: 1.02rem;
  border-left: 3px solid transparent;
}
.drawer-nav a:hover { color: var(--terracotta-dark); background: var(--cream-deep); }
.drawer-nav a.active { color: var(--terracotta-dark); border-left-color: var(--terracotta); background: var(--cream-deep); }
.drawer-social {
  margin-top: auto; padding: 18px 24px; border-top: 1px solid var(--line);
  display: flex; gap: 12px;
}
.drawer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #f5efe2;
}
.drawer-social svg { width: 17px; height: 17px; fill: currentColor; }

@media (max-width: 700px) {
  .site-nav, .site-header .social-icons { display: none; }
  .hamburger { display: inline-flex; }
  .header-inner { gap: 10px; }
  .theme-toggle { margin-left: auto; }
  .hamburger { margin-left: 0; }
}
