/*
Theme Name: Kyashi Angel Premium
Theme URI: https://example.com/kyashi-angel-premium
Author: Heart & Soul Creative
Description: A premium, configurable author theme for Kyashi Angel and Heartwood Hollow.
Version: 1.2.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: kyashi-angel
License: GPL-2.0-or-later
*/

:root {
  --ka-rose: #c85c68;
  --ka-rose-dark: #a84250;
  --ka-ink: #302923;
  --ka-muted: #6f625c;
  --ka-cream: #fff8f3;
  --ka-peach: #f8ddcd;
  --ka-white: #ffffff;
  --ka-border: rgba(111, 75, 66, 0.18);
  --ka-shadow: 0 14px 34px rgba(78, 49, 38, 0.14);
  --ka-serif: Georgia, "Times New Roman", serif;
  --ka-sans: Arial, Helvetica, sans-serif;
  --ka-script: "Brush Script MT", "Segoe Script", cursive;
  --ka-content: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ka-ink);
  background: var(--ka-cream);
  font-family: var(--ka-serif);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; }
.ka-wrap { width: min(var(--ka-content), calc(100% - 48px)); margin-inline: auto; }
.home-section { position: relative; scroll-margin-top: 112px; }
.screen-reader-text,
.skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 9999; top: 12px; left: 12px; padding: 10px 14px; background: var(--ka-white); color: var(--ka-ink); box-shadow: var(--ka-shadow); }

/* Header: the logo is deliberately kept in normal document flow. */
.site-header { position: relative; z-index: 100; background: #fae8df; border-bottom: 1px solid var(--ka-border); }
.header-inner { min-height: 116px; display: grid; grid-template-columns: 215px minmax(0, 1fr) auto; align-items: center; gap: 28px; }
.brand-logo { display: flex; width: 205px; height: 108px; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.main-nav { justify-self: end; min-width: 0; }
.main-nav ul { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 12px 2px; color: var(--ka-ink); font: 700 12px/1.25 var(--ka-sans); text-decoration: none; text-transform: uppercase; letter-spacing: 0.02em; transition: color 0.2s ease; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav .current-menu-item > a { color: var(--ka-rose); }
.main-nav .sub-menu { position: absolute; z-index: 120; top: 100%; left: -18px; display: none; min-width: 210px; padding: 10px 16px; background: var(--ka-white); border: 1px solid var(--ka-border); box-shadow: var(--ka-shadow); }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: block; }
.main-nav .sub-menu a { padding: 9px 2px; white-space: nowrap; }
.social-links { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.social-links a { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 5px; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease; }
.social-links a:hover, .social-links a:focus-visible { transform: translateY(-2px); opacity: 0.82; }
.social-links img { width: 24px; height: 24px; }
.menu-toggle { display: none; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--ka-rose); border-radius: 4px; color: var(--ka-rose-dark); background: transparent; font: 700 12px/1 var(--ka-sans); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after { display: block; width: 20px; height: 2px; background: currentColor; transition: transform 0.2s ease; }
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* Hero */
.hero { min-height: 500px; display: flex; align-items: center; isolation: isolate; background-color: var(--ka-peach); background-repeat: no-repeat; background-size: cover; background-position: center center; overflow: hidden; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(248,221,205,0) 0%, rgba(248,221,205,0) 45%, rgba(248,221,205,0.76) 58%, rgba(248,221,205,0.96) 78%, rgba(248,221,205,0.98) 100%); pointer-events: none; }
.hero > .ka-wrap { display: flex; justify-content: flex-end; }
.hero-content { width: min(47%, 520px); padding: 54px 16px 52px; text-align: center; }
.eyebrow { font: 600 13px/1.4 var(--ka-serif); letter-spacing: 0.28em; text-transform: uppercase; }
.hero h1 { margin: 18px 0 14px; font-size: clamp(36px, 3.45vw, 52px); line-height: 1.08; font-weight: 400; text-wrap: balance; }
.heart-rule { color: var(--ka-rose); font-size: 20px; line-height: 1; }
.hero p { max-width: 470px; margin: 18px auto 24px; font-size: 17px; line-height: 1.48; text-wrap: pretty; }

/* Shared buttons */
.ka-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 12px 24px; border: 0; border-radius: 4px; color: var(--ka-white) !important; background: linear-gradient(180deg, #d36e79 0%, #bd5260 100%); box-shadow: 0 3px 0 var(--ka-rose-dark); font: 700 12px/1.25 var(--ka-sans); letter-spacing: 0.075em; text-align: center; text-decoration: none; text-transform: uppercase; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease; }
.ka-button:hover, .ka-button:focus-visible { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ka-rose-dark); filter: saturate(1.06); }
.ka-button:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--ka-rose-dark); }

/* Welcome */
.welcome { padding: 58px 0 34px; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); align-items: center; gap: clamp(32px, 5vw, 68px); }
.welcome-copy { max-width: 470px; }
.script-title { margin: 0 0 12px; font: 400 clamp(34px, 4vw, 46px)/1.12 var(--ka-script); }
.rose-subtitle { margin-bottom: 14px; color: var(--ka-rose); font-size: 15px; letter-spacing: 0.15em; text-transform: uppercase; }
.welcome-copy p { margin: 0 0 15px; }
.welcome-copy .ka-button { margin-top: 7px; }
.welcome-art { min-width: 0; }
.welcome-art img { width: 100%; max-height: 330px; object-fit: contain; mix-blend-mode: multiply; }

/* Featured books */
.books { padding: 18px 0 58px; text-align: center; }
.section-kicker { font-size: 12px; line-height: 1.4; letter-spacing: 0.24em; text-transform: uppercase; }
.section-title { margin: 6px 0 30px; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.2; font-weight: 400; text-wrap: balance; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: clamp(22px, 3.4vw, 44px); }
.book-card { display: flex; min-width: 0; justify-content: center; border-radius: 3px; text-decoration: none; }
.book-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; filter: drop-shadow(12px 13px 7px rgba(0,0,0,0.2)); transition: transform 0.25s ease, filter 0.25s ease; }
.book-card:hover img, .book-card:focus-visible img { transform: translateY(-7px); filter: drop-shadow(14px 18px 8px rgba(0,0,0,0.22)); }
.books > .ka-wrap > .ka-button { margin-top: 32px; }

/* Newsletter */
.newsletter { padding: 32px 0; background-color: #f7c8c1; background-repeat: no-repeat; background-size: cover; background-position: center; }
.newsletter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); align-items: center; gap: clamp(38px, 6vw, 78px); }
.newsletter-copy { text-align: center; }
.newsletter-copy p { max-width: 500px; margin: 8px auto 0; line-height: 1.45; }
.optin-form { display: grid; gap: 9px; }
.optin-form input { width: 100%; min-height: 43px; padding: 9px 14px; border: 1px solid rgba(168,66,80,0.2); border-radius: 4px; color: var(--ka-ink); background: rgba(255,255,255,0.9); outline: none; }
.optin-form input:focus { border-color: var(--ka-rose); box-shadow: 0 0 0 3px rgba(200,92,104,0.16); }
.optin-form button { width: 100%; }
.form-note { color: #5c4b46; font-size: 11px; line-height: 1.4; text-align: center; }

/* Footer */
.site-footer { padding-top: 30px; background: #fff5ef; border-top: 1px solid rgba(200,92,104,0.1); }
.footer-grid { display: grid; grid-template-columns: 1.25fr 0.9fr 0.9fr 1.2fr; align-items: start; gap: clamp(28px, 4vw, 55px); font-size: 13px; }
.footer-brand p, .footer-home p { margin: 12px 0 0; }
.footer-logo { width: 170px; max-height: 100px; object-fit: contain; }
.footer-title { margin-bottom: 8px; color: var(--ka-rose); font: 700 11px/1.35 var(--ka-serif); letter-spacing: 0.13em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: 3px; }
.site-footer a { color: var(--ka-ink); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--ka-rose-dark); text-decoration: underline; text-underline-offset: 3px; }
.legal-bar { margin-top: 25px; padding: 9px 0; color: var(--ka-white); background: var(--ka-rose); font-size: 11px; }
.legal-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.legal-inner > :last-child { text-align: right; }
.legal-bar a { color: var(--ka-white); }

/* Standard content */
.site-main { min-height: 40vh; }
.entry-content, .page-header { width: min(900px, calc(100% - 48px)); margin: 48px auto; }
.entry-content img { height: auto; }

/* Compact desktop and tablet */
@media (max-width: 1160px) {
  .header-inner { grid-template-columns: 175px minmax(0, 1fr) auto; gap: 18px; }
  .brand-logo { width: 168px; height: 96px; }
  .main-nav ul { gap: 5px 14px; }
  .main-nav a { font-size: 11px; }
  .social-links { gap: 5px; }
  .social-links a, .social-links img { width: 21px; height: 21px; }
  .hero { min-height: 470px; background-position: 47% center; }
  .hero-content { width: 49%; }
}

@media (max-width: 1050px) {
  .ka-wrap { width: min(var(--ka-content), calc(100% - 36px)); }
  .site-header { position: relative; }
  .header-inner { min-height: 92px; grid-template-columns: 155px 1fr auto; gap: 16px; }
  .brand-logo { width: 150px; height: 84px; }
  .menu-toggle { display: inline-flex; grid-column: 3; justify-self: end; }
  .social-links { grid-column: 2; grid-row: 1; justify-self: end; }
  .main-nav { position: absolute; z-index: 130; top: 100%; right: 0; left: 0; display: block; max-height: 0; overflow: hidden; visibility: hidden; opacity: 0; background: var(--ka-white); border-bottom: 1px solid var(--ka-border); box-shadow: 0 14px 24px rgba(70,45,36,0.14); transition: max-height 0.28s ease, opacity 0.2s ease, visibility 0.2s ease; }
  .main-nav.open { max-height: calc(100vh - 92px); overflow-y: auto; visibility: visible; opacity: 1; }
  .main-nav ul { display: block; width: min(100% - 36px, var(--ka-content)); margin: 0 auto; padding: 15px 0 20px; }
  .main-nav li { border-bottom: 1px solid rgba(111,75,66,0.1); }
  .main-nav a { padding: 13px 4px; font-size: 12px; }
  .main-nav .sub-menu { position: static; display: block; min-width: 0; padding: 0 0 7px 18px; border: 0; box-shadow: none; }
  .main-nav .sub-menu li { border: 0; }
  .main-nav .sub-menu a { padding: 8px 4px; }
  .welcome-grid { grid-template-columns: 0.9fr 1.1fr; gap: 34px; }
  .book-grid { gap: 22px; }
  .newsletter-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone and narrow tablet: image and live hero copy become separate layers. */
@media (max-width: 700px) {
  .ka-wrap { width: min(var(--ka-content), calc(100% - 30px)); }
  .header-inner { min-height: 84px; grid-template-columns: 132px 1fr auto; gap: 12px; }
  .brand-logo { width: 128px; height: 76px; }
  .social-links { display: none; }
  .menu-toggle { grid-column: 3; }
  .main-nav.open { max-height: calc(100vh - 84px); }
  .hero { min-height: 0; display: block; padding-top: 300px; background-size: auto 300px; background-position: 41% top; }
  .hero::after { display: none; }
  .hero > .ka-wrap { width: 100%; display: block; }
  .hero-content { width: 100%; padding: 34px 24px 42px; background: linear-gradient(180deg, #f8ddcd 0%, #f8d8c7 100%); }
  .hero h1 { font-size: clamp(32px, 9vw, 42px); }
  .hero p { font-size: 16px; }
  .welcome { padding: 44px 0 20px; }
  .welcome-grid { grid-template-columns: 1fr; gap: 30px; }
  .welcome-copy { max-width: none; text-align: center; }
  .welcome-art { order: -1; }
  .welcome-art img { max-height: 270px; }
  .books { padding: 20px 0 48px; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .newsletter { padding: 38px 0; background-size: auto 100%; }
  .newsletter-grid { grid-template-columns: 1fr; gap: 26px; }
  .optin-form { width: min(100%, 520px); margin-inline: auto; }
  .legal-inner { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .legal-inner > :last-child { text-align: center; }
}

@media (max-width: 440px) {
  .hero { padding-top: 260px; background-size: auto 260px; background-position: 40% top; }
  .hero-content { padding: 30px 18px 38px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.2em; }
  .script-title { font-size: 34px; }
  .section-title { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; text-align: center; }
  .footer-logo { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
