/* ==========================================================================
   Warm Fairy Tale Theme - Global Design
   Applied to ALL pages. Adapted from Figma export.
   ========================================================================== */

/* Fonts loaded via base.html.twig Google Fonts link */

/* --- THEME VARIABLES --- */
:root {
  --hp-bg: #FFF9F2;
  --hp-bg-card: #FFFFFF;
  --hp-accent: #DFAF7D;
  --hp-accent-dark: #b88855;
  --hp-accent-soft: #f5dcc0;
  --hp-text: #1c120e;
  --hp-muted: #877469;
  --hp-radius-lg: 28px;
  --hp-radius-md: 18px;
  --hp-shadow: 0 20px 50px rgba(116,72,27,.18);
  --hp-font-display: "Luckiest Guy", cursive;
  --hp-font-body: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --hp-bg: #1a1d29;
  --hp-bg-card: #25293b;
  --hp-accent: #e0b87d;
  --hp-accent-dark: #c9a26a;
  --hp-accent-soft: #3d3225;
  --hp-text: #f1f3f4;
  --hp-muted: #b8a99f;
  --hp-shadow: 0 20px 50px rgba(0,0,0,.4);
}

/* ==========================================================================
   GLOBAL BODY OVERRIDE
   ========================================================================== */
body {
  font-family: var(--hp-font-body) !important;
  background: radial-gradient(circle at top, #fff4e6 0, var(--hp-bg) 40%, #ffe9d2 85%) no-repeat fixed !important;
  min-height: 100vh;
  color: var(--hp-text) !important;
  padding-top: 0 !important;
}

[data-theme="dark"] body {
  background: radial-gradient(circle at top, #1e2132 0, var(--hp-bg) 40%, #1a1d29 85%) no-repeat fixed !important;
  color: var(--hp-text) !important;
}

/* Hide old side decorations globally */
.side-decoration {
  display: none !important;
}

/* ==========================================================================
   GLOBAL HEADER (pill-shape with logo)
   ========================================================================== */
.hp-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: #fff7ec;
  box-shadow: 0 20px 40px rgba(103,64,27,.26);
  max-width: 1200px;
  margin: 0 auto 0;
}

[data-theme="dark"] .hp-header {
  background: #25293b;
  box-shadow: 0 20px 40px rgba(0,0,0,.5);
}

.hp-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hp-brand-logo {
  height: 64px;
  width: auto;
  border-radius: 50%;
  box-shadow: 0 16px 26px rgba(148,89,32,.25);
}

.hp-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hp-brand-title {
  font-family: var(--hp-font-display);
  font-size: 32px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--hp-text);
}

.hp-brand-title:hover {
  text-decoration: none;
  color: var(--hp-text);
}

.hp-brand-subtitle {
  font-size: 12px;
  color: var(--hp-muted);
}

.hp-nav {
  display: flex;
  gap: 20px;
  font-family: var(--hp-font-display);
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.hp-nav a {
  position: relative;
  text-decoration: none;
  color: var(--hp-text);
  padding-bottom: 4px;
}

.hp-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hp-accent), #ffcc66);
  transition: width .2s ease-out;
}

.hp-nav a:hover::after {
  width: 100%;
}

.hp-nav a:hover {
  text-decoration: none;
}

.hp-nav-highlight {
  padding: 8px 16px !important;
  font-family: var(--hp-font-display) !important;
  font-size: 15px !important;
  letter-spacing: .08em !important;
  background: linear-gradient(135deg, #e7bc8c, var(--hp-accent)) !important;
  color: #3b2616 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(128, 89, 49, 0.45) !important;
  box-shadow: 0 8px 18px rgba(145, 106, 66, 0.3) !important;
}

.hp-nav-highlight::after {
  display: none !important;
}

[data-theme="dark"] .hp-nav-highlight {
  background: linear-gradient(135deg, var(--hp-accent-dark), var(--hp-accent)) !important;
  color: #1a1d29 !important;
}

/* --- THEME TOGGLE IN HEADER --- */
.hp-theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   PAGE WRAPPER
   ========================================================================== */
.hp-page {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 16px 40px;
}

/* ==========================================================================
   GLOBAL BUTTONS
   ========================================================================== */
.hp-btn {
  border-radius: 999px;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s, color .15s;
  white-space: nowrap;
  font-family: var(--hp-font-body);
}

.hp-btn:hover {
  text-decoration: none;
}

.hp-btn-primary {
  background: linear-gradient(135deg, var(--hp-accent), var(--hp-accent-dark));
  color: #fff;
  box-shadow: 0 14px 28px rgba(153, 115, 77, 0.35);
}

.hp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(153, 115, 77, 0.5);
  color: #fff;
}

.hp-btn-ghost {
  background: #fff3e2;
  color: #432720;
  border: 1px solid rgba(149,112,81,.4);
}

[data-theme="dark"] .hp-btn-ghost {
  background: var(--hp-accent-soft);
  color: var(--hp-text);
  border-color: rgba(224, 184, 125, .3);
}

.hp-btn-ghost:hover {
  background: #fff;
  box-shadow: 0 12px 26px rgba(149,112,81,.4);
  transform: translateY(-1px);
  color: #432720;
}

[data-theme="dark"] .hp-btn-ghost:hover {
  background: #3d3830;
  color: var(--hp-text);
}

.hp-btn-small { padding: 6px 12px; font-size: 13px; }
.hp-btn-full { width: 100%; }

.hp-btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  box-shadow: 0 14px 28px rgba(231, 76, 60, 0.35);
}

.hp-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(231, 76, 60, 0.5);
  color: #fff;
}

/* ==========================================================================
   GLOBAL FOOTER
   ========================================================================== */
.hp-footer {
  margin-top: 28px;
  padding: 14px 8px 0;
  font-size: 10px;
  color: var(--hp-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.hp-footer-links {
  display: flex;
  gap: 10px;
}

.hp-footer-links a {
  color: var(--hp-muted);
  text-decoration: none;
  font-size: 10px;
}
.hp-footer-links a:hover { text-decoration: underline; }

/* ==========================================================================
   SUBPAGE CONTENT AREA
   ========================================================================== */
.hp-content {
  margin-top: 32px;
  background: #FFFDF8;
  border-radius: var(--hp-radius-lg);
  padding: 28px 26px;
  box-shadow: var(--hp-shadow);
  color: var(--hp-text);
}

[data-theme="dark"] .hp-content {
  background: var(--hp-bg-card);
}

.hp-content h1 {
  font-family: var(--hp-font-display);
  font-size: 32px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 12px;
  color: var(--hp-text);
}

.hp-content h2 {
  font-family: var(--hp-font-display);
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 24px 0 10px;
  color: var(--hp-text);
}

.hp-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--hp-text);
}

.hp-content a:not(.hp-btn) {
  color: var(--hp-accent-dark);
}

[data-theme="dark"] .hp-content a:not(.hp-btn) {
  color: var(--hp-accent);
}

.hp-content a:not(.hp-btn):hover {
  color: var(--hp-accent);
}

/* Breadcrumb in warm theme */
.hp-content .breadcrumb-list {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 13px;
}

.hp-content .breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-content .breadcrumb-list li:not(:last-child)::after {
  content: '→';
  color: var(--hp-muted);
}

.hp-content .breadcrumb-list a {
  color: var(--hp-accent-dark);
  text-decoration: none;
}

[data-theme="dark"] .hp-content .breadcrumb-list a {
  color: var(--hp-accent);
}

.hp-content .breadcrumb-list a:hover {
  text-decoration: underline;
}

/* Content header */
.hp-content .content-header {
  text-align: center;
  margin-bottom: 24px;
}

.hp-content .content-header p {
  color: var(--hp-muted);
  font-size: 15px;
}

/* Subpage cards grid */
.hp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.hp-card {
  border-radius: var(--hp-radius-md);
  padding: 16px;
  background: #FFF7EE;
  border: 1px solid rgba(223, 175, 125, 0.7);
  transition: transform .15s, box-shadow .15s;
  color: var(--hp-text);
}

[data-theme="dark"] .hp-card {
  background: #2a2d3a;
  border-color: rgba(224, 184, 125, .25);
}

.hp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(116,72,27,.15);
}

[data-theme="dark"] .hp-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}

.hp-card {
  position: relative;
  cursor: pointer;
}

.hp-card > a {
  color: var(--hp-text);
  text-decoration: none;
  display: block;
}

.hp-card > a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hp-card > a:hover {
  text-decoration: none;
}

.hp-card .card-actions {
  position: relative;
  z-index: 2;
}

.hp-card a:hover h2,
.hp-card a:hover h3 {
  color: var(--hp-accent-dark);
}

[data-theme="dark"] .hp-card a:hover h2,
[data-theme="dark"] .hp-card a:hover h3 {
  color: var(--hp-accent);
}

.hp-card h2, .hp-card h3 {
  font-family: var(--hp-font-body);
  text-transform: none;
  letter-spacing: normal;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
  transition: color .15s;
}

.hp-card .card-meta {
  font-size: 13px;
  color: var(--hp-muted);
  margin: 0 0 8px;
}

.hp-card .card-summary {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--hp-text);
}

.hp-card .card-stats {
  display: inline-block;
  background: var(--hp-accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hp-accent-dark);
  margin-bottom: 8px;
}

[data-theme="dark"] .hp-card .card-stats {
  color: var(--hp-accent);
}

.hp-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(223, 175, 125, 0.3);
}

[data-theme="dark"] .hp-card .card-actions {
  border-top-color: rgba(224, 184, 125, .15);
}

/* Navigation buttons in warm theme */
.hp-content-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(223, 175, 125, 0.3);
}

[data-theme="dark"] .hp-content-nav {
  border-top-color: rgba(224, 184, 125, .15);
}

/* ==========================================================================
   SUBPAGE: STORY READER
   ========================================================================== */
.hp-content .tale-header {
  text-align: center;
  border-bottom: 1px solid rgba(223, 175, 125, 0.3);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

[data-theme="dark"] .hp-content .tale-header {
  border-bottom-color: rgba(224, 184, 125, .15);
}

.hp-content .tale-title {
  font-family: var(--hp-font-display);
  font-size: 32px !important;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hp-content .tale-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--hp-muted);
  font-size: 13px;
}

.hp-content .tale-summary {
  background: linear-gradient(135deg, #fff3df, var(--hp-accent-soft));
  padding: 18px;
  border-radius: var(--hp-radius-md);
  margin-bottom: 24px;
  border-left: 4px solid var(--hp-accent);
}

[data-theme="dark"] .hp-content .tale-summary {
  background: linear-gradient(135deg, #2d2a22, var(--hp-accent-soft));
}

.hp-content .content-text {
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  max-width: 65ch;
  margin: 0 auto 28px;
}

.hp-content .action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hp-content .action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #FFF7EE;
  border: 1px solid rgba(223, 175, 125, 0.5);
  border-radius: 999px;
  color: var(--hp-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all .15s;
  cursor: pointer;
}

[data-theme="dark"] .hp-content .action-button {
  background: #2a2d3a;
  border-color: rgba(224, 184, 125, .25);
}

.hp-content .action-button:hover {
  background: var(--hp-accent-soft);
  border-color: var(--hp-accent);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Author info card on story page */
.hp-content .author-info {
  background: linear-gradient(135deg, #fff3df, var(--hp-accent-soft));
  padding: 18px;
  border-radius: var(--hp-radius-md);
  margin-bottom: 20px;
}

[data-theme="dark"] .hp-content .author-info {
  background: linear-gradient(135deg, #2d2a22, var(--hp-accent-soft));
}

.hp-content .author-card {
  position: relative;
  background: var(--hp-bg-card);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(223, 175, 125, 0.5);
  transition: all .15s;
  cursor: pointer;
}

[data-theme="dark"] .hp-content .author-card {
  background: #2a2d3a;
  border-color: rgba(224, 184, 125, .25);
}

.hp-content .author-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(116,72,27,.15);
  border-color: var(--hp-accent);
}

.hp-content .author-card > a {
  color: var(--hp-text);
  text-decoration: none;
  display: block;
}

.hp-content .author-card > a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ==========================================================================
   SUBPAGE: BENEFIT / FEATURE CARDS
   ========================================================================== */
.hp-benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.hp-benefit-card {
  border-radius: var(--hp-radius-md);
  padding: 16px;
  background: linear-gradient(135deg, #fff3e6, #f1d0aa);
  text-align: center;
  transition: transform .15s;
  color: var(--hp-text);
}

[data-theme="dark"] .hp-benefit-card {
  background: linear-gradient(135deg, #2d2a22, var(--hp-accent-soft));
}

.hp-benefit-card:hover {
  transform: translateY(-2px);
}

.hp-benefit-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.hp-benefit-card h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.hp-benefit-card p {
  font-size: 13px;
  margin: 0;
  color: var(--hp-muted);
}

/* ==========================================================================
   FORMS IN WARM THEME
   ========================================================================== */
.hp-content input[type="text"],
.hp-content input[type="email"],
.hp-content input[type="search"],
.hp-content input[type="password"],
.hp-content textarea,
.hp-content select {
  border-radius: 999px;
  border: 1px solid rgba(149,112,81,.4);
  padding: 10px 14px;
  font: inherit;
  outline: none;
  transition: border .12s, box-shadow .12s, background .12s;
  background: var(--hp-bg-card);
  color: var(--hp-text);
  width: 100%;
}

.hp-content textarea {
  border-radius: var(--hp-radius-md);
  min-height: 100px;
  resize: vertical;
}

[data-theme="dark"] .hp-content input[type="text"],
[data-theme="dark"] .hp-content input[type="email"],
[data-theme="dark"] .hp-content input[type="search"],
[data-theme="dark"] .hp-content input[type="password"],
[data-theme="dark"] .hp-content textarea,
[data-theme="dark"] .hp-content select {
  border-color: rgba(224, 184, 125, .3);
  background: #1a1d29;
}

.hp-content input:focus,
.hp-content textarea:focus,
.hp-content select:focus {
  border-color: var(--hp-accent);
  box-shadow: 0 0 0 3px rgba(223, 175, 125,.25);
}

.hp-content .form-group {
  margin-bottom: 14px;
}

/* Checkbox group: checkbox + label side by side */
.hp-content .form-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--hp-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.hp-content .form-group:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.hp-content .form-group:has(input[type="checkbox"]) label {
  display: inline;
  margin-bottom: 0;
  cursor: pointer;
}

.hp-content label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-muted);
  margin-bottom: 4px;
}

/* Form validation errors */
.hp-content .form-error-message,
.hp-content ul li[class*="error"],
.hp-content .help-text {
  font-size: 12px;
}

.hp-content .form-error-message,
.hp-content .form_errors li,
.hp-content ul.form-errors li {
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
}

.hp-content .has-error input,
.hp-content .has-error textarea,
.hp-content .has-error select,
.hp-content input.is-invalid,
.hp-content textarea.is-invalid,
.hp-content select.is-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .2) !important;
}

/* Symfony form errors rendering */
.hp-content .form-group ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.hp-content .form-group ul li {
  color: #dc3545;
  font-size: 12px;
  font-weight: 600;
}

.hp-content .form-group:has(ul li) input,
.hp-content .form-group:has(ul li) textarea,
.hp-content .form-group:has(ul li) select {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .2) !important;
}

/* Error list next to checkbox (not above) */
.hp-content .form-group:has(input[type="checkbox"]) ul {
  width: 100%;
}

.hp-content .form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hp-content .form-actions button,
.hp-content .form-actions input[type="submit"] {
  border-radius: 999px;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--hp-accent), var(--hp-accent-dark));
  color: #fff;
  box-shadow: 0 14px 28px rgba(153, 115, 77, 0.35);
  transition: all .15s;
}

.hp-content .form-actions button:hover,
.hp-content .form-actions input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(153, 115, 77, 0.5);
}

/* Flash messages */
.hp-content .flash-message {
  padding: 12px 16px;
  border-radius: var(--hp-radius-md);
  margin-bottom: 16px;
  font-size: 14px;
}

.hp-content .flash-success {
  background: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.3);
  color: #155724;
}

[data-theme="dark"] .hp-content .flash-success {
  background: rgba(40, 167, 69, 0.15);
  color: #6fcf97;
}

.hp-content .flash-error {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: #721c24;
}

[data-theme="dark"] .hp-content .flash-error {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
}

/* Comments section warm */
.hp-content .comments-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(223, 175, 125, 0.3);
}

[data-theme="dark"] .hp-content .comments-section {
  border-top-color: rgba(224, 184, 125, .15);
}

.hp-content .comment {
  background: #FFF7EE;
  border: 1px solid rgba(223, 175, 125, 0.5);
  border-radius: var(--hp-radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

[data-theme="dark"] .hp-content .comment {
  background: #2a2d3a;
  border-color: rgba(224, 184, 125, .2);
}

/* ==========================================================================
   HOMEPAGE-SPECIFIC (hero, moon card, search+tales layout)
   ========================================================================== */

/* Hero section */
.hp-hero {
  margin-top: 32px;
  padding: 30px 28px;
  border-radius: 40px;
  background: var(--hp-bg-card);
  box-shadow: var(--hp-shadow);
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  gap: 32px;
}

.hp-hero-text {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.hp-eyebrow {
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--hp-muted);
  margin: 0 0 10px;
}

.hp-hero h1 {
  font-family: var(--hp-font-display);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 14px;
  text-align: center;
  color: var(--hp-text);
}

.hp-hero-lead {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--hp-text);
}

.hp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.hp-hero-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
  gap: 6px;
  font-size: 13px;
  color: var(--hp-muted);
}

.hp-hero-benefits li {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1de;
}

[data-theme="dark"] .hp-hero-benefits li {
  background: var(--hp-accent-soft);
}

/* Moon card */
.hp-moon-card {
  background: radial-gradient(circle at top, #FFF9F2 0, #FFF9F2 40%, #F7E9DC 85%);
  border-radius: 32px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: 0 26px 60px rgba(140,88,29,.35);
}

[data-theme="dark"] .hp-moon-card {
  background: radial-gradient(circle at top, #2a2d3a 0, #25293b 40%, #1e2030 85%);
  box-shadow: 0 26px 60px rgba(0,0,0,.6);
}

.hp-moon-graphic {
  position: relative;
  height: 150px;
  border-radius: 24px;
  background: linear-gradient(180deg, #2b1c30, #4a2c55);
  overflow: hidden;
}

.hp-moon-circle {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fffdf5 0, #ffe6b9 40%, #ffcf88 100%);
  right: 26px;
  top: 26px;
  box-shadow: 0 0 40px rgba(255,207,136,.9);
}

.hp-moon-crater { position: absolute; border-radius: 50%; background: rgba(255,194,120,.8); }
.hp-crater-1 { width: 16px; height: 16px; right: 32px; top: 44px; }
.hp-crater-2 { width: 12px; height: 12px; right: 60px; top: 70px; }

.hp-moon-cloud { position: absolute; width: 90px; height: 42px; background: #fffaf4; border-radius: 36px; bottom: 20px; box-shadow: 0 10px 26px rgba(24,8,38,.7); }
.hp-moon-cloud::before, .hp-moon-cloud::after { content: ""; position: absolute; border-radius: 50%; background: #fffaf4; }
.hp-cloud-left { left: 22px; }
.hp-cloud-left::before { width: 40px; height: 40px; top: -18px; left: 6px; }
.hp-cloud-left::after { width: 34px; height: 34px; top: -14px; right: 6px; }
.hp-cloud-right { right: 18px; transform: scale(.8); }
.hp-cloud-right::before { width: 36px; height: 36px; top: -18px; left: 4px; }
.hp-cloud-right::after { width: 30px; height: 30px; top: -14px; right: 4px; }

.hp-moon-card-body { padding-top: 14px; font-size: 14px; color: var(--hp-text); }
.hp-moon-card-body h2 { margin: 0 0 6px; font-family: var(--hp-font-display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--hp-text); }
.hp-moon-card-body p { margin: 0 0 8px; }
.hp-moon-list { margin: 0 0 10px; padding-left: 18px; color: var(--hp-text); }

/* Homepage search + tales layout */
.hp-layout { margin-top: 26px; display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.6fr); gap: 22px; }

.hp-search-panel { background: #FFFDF8; border-radius: var(--hp-radius-lg); padding: 18px; box-shadow: var(--hp-shadow); }
[data-theme="dark"] .hp-search-panel { background: var(--hp-bg-card); }
.hp-search-panel h2 { margin: 0 0 6px; font-size: 18px; color: var(--hp-text); }
.hp-search-description { margin: 0 0 14px; font-size: 13px; color: var(--hp-muted); }

.hp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.hp-field span { color: var(--hp-muted); }
.hp-field input, .hp-field select { border-radius: 999px; border: 1px solid rgba(149,112,81,.4); padding: 9px 12px; font: inherit; outline: none; transition: border .12s, box-shadow .12s, background .12s; background: var(--hp-bg-card); color: var(--hp-text); }
[data-theme="dark"] .hp-field input, [data-theme="dark"] .hp-field select { border-color: rgba(224, 184, 125, .3); background: #1a1d29; }
.hp-field input:focus, .hp-field select:focus { border-color: var(--hp-accent); box-shadow: 0 0 0 3px rgba(223, 175, 125,.25); background: var(--hp-bg-card); }

.hp-search-actions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 18px; }

.hp-newest-section { margin-top: 18px; }
.hp-newest-section h3 { font-size: 16px; margin: 0 0 10px; color: var(--hp-text); }
.hp-newest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hp-newest-list li { position: relative; padding: 0; border-radius: var(--hp-radius-md); background: #FFF7EE; border: 1px solid rgba(223, 175, 125, 0.4); transition: transform .12s, box-shadow .12s; }
[data-theme="dark"] .hp-newest-list li { background: #2a2d3a; border-color: rgba(224, 184, 125, .2); }
.hp-newest-list li:hover { transform: translateX(4px); box-shadow: 0 2px 8px rgba(116,72,27,.1); }
[data-theme="dark"] .hp-newest-list li:hover { box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hp-newest-list a { font-size: 14px; font-weight: 600; color: var(--hp-text); text-decoration: none; display: block; padding: 8px 10px; }
.hp-newest-list a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hp-newest-list a:hover { text-decoration: underline; }
.hp-newest-meta { font-size: 12px; color: var(--hp-muted); display: block; margin-top: 2px; }

.hp-info-card { margin-top: 16px; padding: 12px 12px 14px; border-radius: var(--hp-radius-md); background: linear-gradient(135deg, #fff3df, var(--hp-accent-soft)); font-size: 13px; color: var(--hp-text); }
[data-theme="dark"] .hp-info-card { background: linear-gradient(135deg, #2d2a22, var(--hp-accent-soft)); }
.hp-info-card h3 { font-size: 15px; margin: 0 0 6px; color: var(--hp-text); }

.hp-stories-panel { background: #FFFDF8; border-radius: var(--hp-radius-lg); padding: 18px 20px 20px; box-shadow: var(--hp-shadow); }
[data-theme="dark"] .hp-stories-panel { background: var(--hp-bg-card); }
.hp-stories-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; align-items: flex-start; }
.hp-stories-header h2 { margin: 0 0 6px; color: var(--hp-text); }
.hp-muted { color: var(--hp-muted); font-size: 13px; }

.hp-story-list { display: grid; gap: 14px; }
.hp-story-card { position: relative; border-radius: 18px; padding: 14px 14px 12px; background: #FFF7EE; border: 1px solid rgba(223, 175, 125, 0.7); overflow: hidden; transition: transform .15s, box-shadow .15s; }
[data-theme="dark"] .hp-story-card { background: #2a2d3a; border-color: rgba(224, 184, 125, .25); }
.hp-story-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(116,72,27,.15); }
[data-theme="dark"] .hp-story-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.hp-story-card::after { content: ""; position: absolute; right: -30px; top: -26px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,186,130,.25), transparent 60%); pointer-events: none; }
[data-theme="dark"] .hp-story-card::after { background: radial-gradient(circle, rgba(224,184,125,.08), transparent 60%); }

.hp-story-badge { position: absolute; top: 10px; right: 12px; font-size: 11px; background: #ffe08f; padding: 3px 8px; border-radius: 999px; z-index: 1; color: #5a3e0a; }
[data-theme="dark"] .hp-story-badge { background: rgba(255, 224, 143, .2); color: #ffdd93; }

.hp-story-card { cursor: pointer; }
.hp-story-card h3 { margin: 0 0 4px; font-size: 17px; color: var(--hp-text); }
.hp-story-card h3 a { color: var(--hp-text); text-decoration: none; }
.hp-story-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hp-story-card h3 a:hover { text-decoration: underline; }
.hp-story-meta { margin: 0 0 6px; font-size: 13px; color: var(--hp-muted); }
.hp-story-excerpt { margin: 0 0 8px; font-size: 14px; color: var(--hp-text); }

/* Sections (recommended, authors, promo, newsletter) */
.hp-section-heading { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; align-items: center; text-align: center; }
.hp-section { margin-top: 28px; padding: 20px 22px 22px; border-radius: var(--hp-radius-lg); background: #FFFDF8; box-shadow: var(--hp-shadow); }
[data-theme="dark"] .hp-section { background: var(--hp-bg-card); }
.hp-section h2 { font-family: var(--hp-font-display); letter-spacing: .06em; text-transform: uppercase; font-size: 24px; color: var(--hp-text); }

.hp-recommended-grid, .hp-author-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }

.hp-recommend-card { border-radius: var(--hp-radius-md); padding: 14px; background: linear-gradient(135deg, #fff3e6, #f1d0aa); font-size: 14px; color: var(--hp-text); transition: transform .15s, box-shadow .15s; }
[data-theme="dark"] .hp-recommend-card { background: linear-gradient(135deg, #2d2a22, var(--hp-accent-soft)); }
.hp-recommend-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(116,72,27,.15); }
.hp-recommend-card { position: relative; cursor: pointer; }
.hp-recommend-card h3 { font-size: 16px; margin: 0 0 6px; color: var(--hp-text); }
.hp-recommend-card p { margin: 0 0 10px; }
.hp-recommend-link { display: block; text-decoration: none; color: var(--hp-text); height: 100%; }
.hp-recommend-link:hover { text-decoration: none; color: var(--hp-text); }
.hp-recommend-link:hover h3 { color: var(--hp-accent-dark); }
[data-theme="dark"] .hp-recommend-link:hover h3 { color: var(--hp-accent); }

.hp-author-card { border-radius: var(--hp-radius-md); padding: 14px; background: #FFF7EE; border: 1px solid rgba(223, 175, 125, 0.7); transition: transform .15s, box-shadow .15s; color: var(--hp-text); }
[data-theme="dark"] .hp-author-card { background: #2a2d3a; border-color: rgba(224, 184, 125, .25); }
.hp-author-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(116,72,27,.15); }
.hp-author-card { position: relative; cursor: pointer; }
.hp-author-card h3 { font-size: 16px; margin: 0 0 6px; color: var(--hp-text); }
.hp-author-card h3 a { color: var(--hp-text); text-decoration: none; }
.hp-author-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.hp-author-card h3 a:hover { color: var(--hp-accent); }

.hp-promo-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.hp-promo-inner h2 { margin: 0 0 6px; }
.hp-promo-inner p { margin: 0; color: var(--hp-text); }

.hp-newsletter-inner { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 22px; align-items: center; }
.hp-newsletter-inner h2 { margin: 0 0 6px; }
.hp-newsletter-inner p { margin: 0; color: var(--hp-text); }
.hp-newsletter-form { display: flex; flex-direction: column; gap: 10px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  .hp-header { border-radius: 24px; padding-inline: 16px; }
  .hp-hero { grid-template-columns: minmax(0,1fr); }
  .hp-layout { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 768px) {
  .hp-nav { font-size: 12px; gap: 10px; }
  .hp-brand-title { font-size: 24px; }
  .hp-brand-logo { height: 48px; }
  .hp-hero h1 { font-size: 28px; }
  .hp-content h1 { font-size: 26px; }
  .hp-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hp-page { padding: 16px 10px 28px; }
  .hp-header { border-radius: 24px; }
  .hp-hero { padding: 22px 16px; border-radius: 32px; }
  .hp-section { padding: 16px 14px 18px; border-radius: 24px; }
  .hp-newsletter-inner { grid-template-columns: minmax(0,1fr); }
  .hp-footer { flex-direction: column; align-items: flex-start; }
  .hp-promo-inner { flex-direction: column; text-align: center; }
  .hp-content { padding: 20px 16px; border-radius: 24px; }
  .hp-content-nav { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .hp-hero h1 { font-size: 24px; }
  .hp-nav { font-size: 11px; gap: 8px; }
  .hp-hero-actions { flex-direction: column; align-items: center; }
  .hp-content h1 { font-size: 22px; }
}

/* ==========================================================================
   PRIVACY POLICY SECTIONS
   ========================================================================== */
.hp-content .privacy-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(223, 175, 125, 0.2);
}

.hp-content .privacy-section:last-child {
  border-bottom: none;
}

.hp-content .privacy-section ul,
.hp-content .privacy-section ol {
  padding-left: 20px;
  margin: 10px 0;
}

.hp-content .privacy-section li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.hp-content .privacy-section p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.hp-content details {
  margin-top: 12px;
}

.hp-content summary {
  cursor: pointer;
  color: var(--hp-accent-dark);
  font-weight: 600;
}

[data-theme="dark"] .hp-content summary {
  color: var(--hp-accent);
}

/* ==========================================================================
   VISUALLY HIDDEN UTILITY
   ========================================================================== */
.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;
}

/* ==========================================================================
   SKIP LINK
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--hp-accent);
  color: #fff;
  padding: 8px;
  z-index: 200;
  transition: top .2s;
}

.skip-link:focus {
  top: 0;
}
