/*
Theme Name: RicelyDone
Theme URI: https://itsricelydone.com
Description: Block theme for RicelyDone, a rice milk and rice flour brand. Child theme of Twenty Twenty-Five.
Author: RicelyDone
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.5
Text Domain: ricelydone
*/

/* ==========================================================================
   Tokens. One palette, one accent (paddy lime), light and dark.
   Radius rule: containers 24px, nested media 16px, buttons and chips pill.
   ========================================================================== */
:root {
  color-scheme: light dark;
  --rd-bg: #f3f6f1;
  --rd-surface: #fafcf8;
  --rd-ink: #0e1a14;
  --rd-muted: #49594f;
  --rd-line: rgba(14, 26, 20, 0.12);
  --rd-accent: #b9dc4b;
  --rd-accent-ink: #0e1a14;
  --rd-tint-1: #e4ebdd;
  --rd-tint-2: #d3decb;
  --rd-deep: #16241c;
  --rd-deep-ink: #eaf1e4;
  --rd-em-bg: linear-gradient(transparent 58%, var(--rd-accent) 58% 92%, transparent 92%);
  --rd-em-color: inherit;
  --rd-radius: 24px;
  --rd-radius-sm: 16px;
  --rd-gutter: clamp(16px, 4vw, 40px);
  --rd-max: 1280px;
  --rd-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --rd-body: "Geist", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --rd-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --rd-bg: #0c1410;
    --rd-surface: #121d17;
    --rd-ink: #eaf1e4;
    --rd-muted: #9fb0a4;
    --rd-line: rgba(234, 241, 228, 0.14);
    --rd-tint-1: #17231c;
    --rd-tint-2: #1e2d24;
    --rd-deep: #1b2a21;
    --rd-em-bg: none;
    --rd-em-color: var(--rd-accent);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
html { scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--rd-bg);
  color: var(--rd-ink);
  font-family: var(--rd-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wp-site-blocks > * { margin-block-start: 0 !important; }
.rd-main { --wp--style--block-gap: 0; }
.rd-main.is-layout-flow > * { margin-block-start: 0 !important; }
.rd-main section, .rd-header, .rd-footer { box-sizing: border-box; }

.rd-wrap {
  width: min(var(--rd-max), 100% - 2 * var(--rd-gutter));
  margin-inline: auto;
}

.rd-main h1, .rd-main h2, .rd-main h3,
.rd-footer h3 {
  font-family: var(--rd-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: inherit;
  margin: 0;
  text-wrap: balance;
}
.rd-main p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--rd-ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--rd-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--rd-ease), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.rd-btn:active { transform: translateY(1px) scale(0.98); }
.rd-btn--primary { background: var(--rd-ink); color: var(--rd-bg); }
.rd-btn--primary:hover { background: var(--rd-accent); color: var(--rd-accent-ink); transform: translateY(-2px); }
.rd-btn--ghost { background: transparent; color: var(--rd-ink); border-color: var(--rd-ink); }
.rd-btn--ghost:hover { background: var(--rd-tint-2); transform: translateY(-2px); }
.rd-btn--on-accent { background: #0e1a14; color: #f3f6f1; }
.rd-btn--on-accent:hover { background: #f3f6f1; color: #0e1a14; transform: translateY(-2px); }

/* ==========================================================================
   Header
   ========================================================================== */
.wp-site-blocks > header { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > header { top: 32px; }

.rd-header {
  background: color-mix(in srgb, var(--rd-bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rd-line);
}
@media (prefers-reduced-transparency: reduce) {
  .rd-header { background: var(--rd-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.rd-header__bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
}
.rd-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--rd-ink);
  text-decoration: none;
  font-family: var(--rd-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.rd-logo__grain {
  width: 0.7rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--rd-accent);
  transform: rotate(24deg);
  box-shadow: inset 0 0 0 1.5px var(--rd-ink);
}
.rd-nav { display: flex; gap: 1.75rem; margin-left: auto; }
.rd-nav a {
  color: var(--rd-ink);
  text-decoration: none;
  font-size: 0.97rem;
  font-weight: 500;
  padding-block: 0.4rem;
  background: linear-gradient(var(--rd-ink), var(--rd-ink)) left bottom / 0 1.5px no-repeat;
  transition: background-size 0.3s var(--rd-ease);
}
.rd-nav a:hover { background-size: 100% 1.5px; }
.rd-header__cta { padding: 0.7rem 1.3rem; }

.rd-menu { display: none; position: relative; }
.rd-menu summary {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1.5px solid var(--rd-ink);
}
.rd-menu summary::-webkit-details-marker { display: none; }
.rd-menu__bars, .rd-menu__bars::before {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--rd-ink);
  content: "";
  position: relative;
}
.rd-menu__bars::before { top: 5px; }
.rd-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 220px;
  padding: 0.5rem;
  display: grid;
  background: var(--rd-surface);
  border: 1px solid var(--rd-line);
  border-radius: var(--rd-radius-sm);
  box-shadow: 0 18px 40px rgba(14, 26, 20, 0.14);
}
.rd-menu__panel a {
  padding: 0.85rem 1rem;
  color: var(--rd-ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: 10px;
}
.rd-menu__panel a:hover { background: var(--rd-tint-1); }

@media (max-width: 899px) {
  .rd-nav { display: none; }
  .rd-menu { display: block; }
  .rd-header__cta { margin-left: auto; }
  .rd-header__bar { gap: 0.75rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.rd-hero { padding-block: clamp(2rem, 5vw, 4.5rem) clamp(3rem, 7vw, 6rem); }
.rd-hero__grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.rd-hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}
.rd-hero h1 em {
  font-style: normal;
  background: var(--rd-em-bg);
  color: var(--rd-em-color);
  padding-inline: 0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.rd-lede {
  margin-top: 1.5rem !important;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--rd-muted);
}
.rd-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.rd-hero__visual {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--rd-radius);
  overflow: hidden;
  background: linear-gradient(165deg, var(--rd-tint-2), var(--rd-tint-1));
  isolation: isolate;
}
/* Fallback art shown until the photograph is added: a lime sun and two grains */
.rd-hero__visual::before {
  content: "";
  position: absolute;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--rd-accent);
  right: -8%;
  top: -6%;
  z-index: -1;
}
.rd-hero__grain {
  position: absolute;
  background: var(--rd-surface);
  border-radius: 50%;
  z-index: -1;
  box-shadow: inset 0 0 0 1.5px var(--rd-line);
}
.rd-hero__grain--a { width: 26%; aspect-ratio: 1 / 2.4; left: 14%; bottom: 10%; transform: rotate(-24deg); }
.rd-hero__grain--b { width: 20%; aspect-ratio: 1 / 2.4; left: 46%; bottom: 20%; transform: rotate(18deg); }
.rd-hero__photo {
  position: absolute;
  inset: 0;
  background: url("assets/img/hero.jpg") center / cover no-repeat;
}

@media (max-width: 899px) {
  .rd-hero__grid { grid-template-columns: 1fr; }
  .rd-hero__visual { aspect-ratio: 5 / 4; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.rd-section { padding-block: clamp(4rem, 9vw, 8rem); }
.rd-h2 { font-size: clamp(2rem, 4.4vw, 3.75rem); }
.rd-sub { margin-top: 1rem !important; max-width: 40rem; font-size: 1.15rem; color: var(--rd-muted); line-height: 1.55; }

/* Products: bento with five tiles */
.rd-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}
.rd-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  min-height: 320px;
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: var(--rd-radius);
  overflow: hidden;
  transition: transform 0.4s var(--rd-ease);
}
.rd-tile:hover { transform: translateY(-4px); }
.rd-tile h3 { font-size: clamp(1.6rem, 2.6vw, 2.4rem); }
.rd-tile p { max-width: 30rem; line-height: 1.5; }
.rd-tile__variants { font-size: 0.92rem; font-weight: 600; opacity: 0.8; }
.rd-tile__img {
  flex: 1;
  min-height: 190px;
  border-radius: var(--rd-radius-sm);
  background:
    radial-gradient(70% 70% at 72% 28%, color-mix(in srgb, var(--rd-accent) 60%, transparent), transparent 70%),
    color-mix(in srgb, currentColor 7%, transparent);
}
.rd-tile--milk { grid-column: span 7; background: var(--rd-accent); color: var(--rd-accent-ink); min-height: 480px; }
.rd-tile--milk .rd-tile__img {
  background:
    url("assets/img/rice-milk.jpg") center / cover no-repeat,
    radial-gradient(70% 70% at 70% 30%, rgba(255, 255, 255, 0.55), transparent 70%),
    rgba(14, 26, 20, 0.08);
}
.rd-tile--flour { grid-column: span 5; background: var(--rd-deep); color: var(--rd-deep-ink); min-height: 480px; }
.rd-tile--flour .rd-tile__img {
  background:
    url("assets/img/rice-flour.jpg") center / cover no-repeat,
    radial-gradient(70% 70% at 30% 30%, color-mix(in srgb, var(--rd-accent) 38%, transparent), transparent 70%),
    rgba(234, 241, 228, 0.07);
}
.rd-tile--brown { grid-column: span 3; background: var(--rd-tint-1); }
.rd-tile--sweet { grid-column: span 5; background: var(--rd-surface); box-shadow: inset 0 0 0 1px var(--rd-line); }
.rd-tile--noodle {
  grid-column: span 4;
  background:
    radial-gradient(90% 90% at 100% 0%, color-mix(in srgb, var(--rd-accent) 45%, transparent), transparent 62%),
    var(--rd-tint-2);
}
.rd-tile--brown, .rd-tile--sweet, .rd-tile--noodle { min-height: 300px; }
.rd-tile--brown p, .rd-tile--sweet p, .rd-tile--noodle p { color: var(--rd-muted); }

@media (max-width: 899px) {
  .rd-bento { grid-template-columns: 1fr; }
  .rd-tile, .rd-tile--milk, .rd-tile--flour, .rd-tile--brown, .rd-tile--sweet, .rd-tile--noodle { grid-column: auto; }
  .rd-tile--milk, .rd-tile--flour { min-height: 420px; }
  .rd-tile--brown, .rd-tile--sweet, .rd-tile--noodle { min-height: 240px; }
}

/* Why rice: sticky headline beside a stacked list */
.rd-why { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(2rem, 6vw, 6rem); }
.rd-why__head { position: sticky; top: 120px; align-self: start; }
.rd-why__item { padding-block: 2.25rem; border-top: 1px solid var(--rd-line); }
.rd-why__item:first-child { padding-top: 0; border-top: 0; }
.rd-why__item h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.rd-why__item p { margin-top: 0.75rem !important; max-width: 36rem; color: var(--rd-muted); line-height: 1.6; }
@media (max-width: 899px) {
  .rd-why { grid-template-columns: 1fr; }
  .rd-why__head { position: static; }
}

/* Story: full-bleed image with a text card */
.rd-story {
  position: relative;
  margin-inline: clamp(12px, 2vw, 24px);
  min-height: min(78dvh, 720px);
  display: flex;
  align-items: flex-end;
  border-radius: var(--rd-radius);
  overflow: hidden;
  background:
    url("assets/img/paddy-field.jpg") center / cover no-repeat,
    radial-gradient(60% 80% at 80% 10%, color-mix(in srgb, var(--rd-accent) 55%, transparent), transparent 65%),
    linear-gradient(180deg, #2b4a36, #16241c);
}
.rd-story__inner { padding-block: clamp(1rem, 3vw, 2.5rem); }
.rd-story__card {
  max-width: 30rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--rd-radius);
  background: var(--rd-surface);
  color: var(--rd-ink);
}
.rd-story__card h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.rd-story__card p { margin-top: 1rem !important; color: var(--rd-muted); line-height: 1.6; }

/* Ideas: scroll-snap row */
.rd-eyebrow {
  margin-bottom: 1rem !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rd-muted);
}
.rd-scroller {
  display: flex;
  gap: 16px;
  margin-top: clamp(2rem, 4vw, 3rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rd-tint-2) transparent;
}
.rd-idea {
  flex: 0 0 min(78vw, 300px);
  scroll-snap-align: start;
  min-height: 280px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6rem;
  border-radius: var(--rd-radius);
  background: var(--rd-tint-1);
}
.rd-idea:nth-child(even) { background: var(--rd-tint-2); }
.rd-idea:nth-child(3n) { background: var(--rd-surface); box-shadow: inset 0 0 0 1px var(--rd-line); }
.rd-idea h3 { font-size: 1.7rem; }
.rd-idea p { color: var(--rd-muted); line-height: 1.5; }

/* Closing call to action */
.rd-cta { padding-block: 0 clamp(4rem, 9vw, 8rem); }
.rd-cta__panel {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
  padding: clamp(2rem, 6vw, 5rem);
  border-radius: var(--rd-radius);
  background: var(--rd-accent);
  color: var(--rd-accent-ink);
}
.rd-cta__panel h2 { font-size: clamp(2.4rem, 6vw, 5.2rem); }
.rd-cta__panel p { font-size: 1.15rem; max-width: 30rem; line-height: 1.5; }

/* ==========================================================================
   Footer
   ========================================================================== */
.rd-footer { border-top: 1px solid var(--rd-line); padding-top: clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.rd-footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.rd-footer__tag { margin-top: 1rem; max-width: 22rem; color: var(--rd-muted); line-height: 1.5; }
.rd-footer h3 { font-size: 1rem; letter-spacing: -0.01em; margin-bottom: 1rem; }
.rd-footer nav { display: grid; gap: 0.6rem; align-content: start; }
.rd-footer nav a { color: var(--rd-muted); text-decoration: none; }
.rd-footer nav a:hover { color: var(--rd-ink); }
.rd-footer__bottom { margin-top: 3rem; font-size: 0.9rem; color: var(--rd-muted); }
.rd-footer__mark {
  margin-top: 1rem;
  font-family: var(--rd-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 17vw, 15rem);
  letter-spacing: -0.06em;
  line-height: 0.78;
  color: var(--rd-tint-2);
  white-space: nowrap;
  user-select: none;
  transform: translateY(12%);
}
@media (max-width: 699px) {
  .rd-footer__top { grid-template-columns: 1fr 1fr; }
  .rd-footer__top > div:first-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   Motion. Hero entrance sets reading order; scroll reveal sequences sections.
   Everything is disabled for visitors who prefer reduced motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .rd-in {
    opacity: 0;
    transform: translateY(18px);
    animation: rd-rise 0.9s var(--rd-ease) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }
  @keyframes rd-rise { to { opacity: 1; transform: none; } }

  .rd-js .rd-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--rd-ease), transform 0.8s var(--rd-ease);
    transition-delay: calc(var(--d, 0) * 70ms);
    animation: rd-failsafe 0s 3s forwards;
  }
  .rd-js .rd-reveal.is-in { opacity: 1; transform: none; }
  @keyframes rd-failsafe { to { opacity: 1; transform: none; } }
}
