/* =====================================================================
   TechyReviews — Main Stylesheet  (Trustpilot-inspired light theme)
   ---------------------------------------------------------------------
   How this file is organised (search these headings to jump around):
     1.  Design tokens (colours, fonts, spacing)  ->  :root
     2.  Base / reset
     3.  Layout helpers (container, grid, sections)
     4.  Buttons
     5.  Navbar
     6.  Footer
     7.  Hero
     8.  Category chips + colourful category tiles
     9.  Review cards
     10. Star-rating widget (green Trustpilot-style boxes)
     11. Single review post (pros/cons, rating, CTA)
     12. About page
     13. Contact page + form
     14. Utilities
     15. Responsive tweaks (mobile-first: overrides live at the bottom)

   EDITING TIP: To re-brand the whole site, change the colour + accent
   values in section 1 (:root) and everything else follows automatically.
   ===================================================================== */

/* =====================================================================
   1. DESIGN TOKENS
   ===================================================================== */
:root {
  /* --- Surfaces / backgrounds (light theme) --- */
  --color-bg:            #ffffff;   /* page background — white           */
  --color-bg-alt:        #f9f8f5;   /* warm off-white section background  */
  --color-surface:       #ffffff;   /* cards / panels                     */
  --color-surface-2:     #f4f2ee;   /* hover / secondary surfaces         */
  --color-border:        #e9e4e0;   /* subtle borders                     */
  --color-border-strong: #c6c0bb;   /* stronger borders                   */

  /* --- Brand / accent --- */
  --color-accent:        #00b67a;   /* Trustpilot-style green             */
  --color-accent-hover:  #00996a;   /* darker green for hover             */
  --color-accent-soft:   rgba(0, 182, 122, 0.10); /* tinted backgrounds   */
  --color-dark:          #121511;   /* near-black — buttons + headings    */
  --color-dark-hover:    #2a2d28;

  /* --- Text --- */
  --color-text:          #121511;   /* main body text — warm near-black  */
  --color-text-muted:    #605e56;   /* secondary / meta text             */
  --color-heading:       #121511;   /* headings                          */

  /* --- Feedback / ratings --- */
  --color-pro:           #1a8f4c;   /* green — pros                      */
  --color-con:           #cb2f3f;   /* red — cons                        */
  --color-star:          #00b67a;   /* filled star box — green           */
  --color-star-empty:    #dcdce6;   /* empty star box — light grey       */

  /* --- Typography --- */
  --font-body: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto,
               system-ui, sans-serif;
  --font-heading: var(--font-body);

  /* --- Spacing scale --- */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* --- Misc --- */
  --radius:      16px;   /* default corner radius (cards)      */
  --radius-sm:   10px;
  --radius-pill: 100px;  /* pill buttons                       */
  --max-width:   1160px; /* content container width            */
  --shadow:      0 6px 24px rgba(18, 21, 17, 0.08);
  --shadow-hover:0 12px 32px rgba(18, 21, 17, 0.12);
  --transition:  0.2s ease;
}

/* =====================================================================
   2. BASE / RESET
   ===================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  /* Keeps the footer at the bottom even on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

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

a {
  color: var(--color-dark);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 {
  color: var(--color-heading);
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  font-weight: 800;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--space-sm); }

/* Accessible focus outline for keyboard users */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* =====================================================================
   3. LAYOUT HELPERS
   ===================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Vertical rhythm for page sections */
.section { padding: var(--space-xl) 0; }
.section--tight { padding: var(--space-lg) 0; }
/* Warm off-white band (alternate sections for that Trustpilot rhythm) */
.section--alt { background: var(--color-bg-alt); }

/* Section heading block (title + optional subtitle) */
.section-head { margin-bottom: var(--space-lg); }
.section-head h2 { margin-bottom: var(--space-xs); }
.section-head p { color: var(--color-text-muted); margin: 0; font-size: 1.05rem; }

/* Reusable responsive card grid */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* =====================================================================
   4. BUTTONS  (Trustpilot uses dark pill buttons)
   ===================================================================== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), color var(--transition),
              box-shadow var(--transition);
  text-align: center;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }

/* Primary — solid near-black (Trustpilot's main button) */
.btn--primary {
  background: var(--color-dark);
  color: #fff;
}
.btn--primary:hover { background: var(--color-dark-hover); color: #fff; }

/* Accent — brand green */
.btn--accent {
  background: var(--color-accent);
  color: #fff;
}
.btn--accent:hover { background: var(--color-accent-hover); color: #fff; }

/* Secondary — outlined */
.btn--outline {
  background: transparent;
  color: var(--color-dark);
  border-color: var(--color-border-strong);
}
.btn--outline:hover {
  border-color: var(--color-dark);
  color: var(--color-dark);
}

/* Affiliate CTA — amazon-style amber, used on review posts */
.btn--cta {
  background: #ffa41c;
  color: #111;
  font-size: 1.05rem;
  padding: 0.95rem 2rem;
  border-color: #ff8f00;
}
.btn--cta:hover { background: #ff8f00; color: #111; }

/* =====================================================================
   5. NAVBAR  (markup is injected by /js/components.js)
   ===================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Brand / logo — green star + "TechyReviews." wordmark */
.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -0.02em;
}
.navbar__brand:hover { color: var(--color-dark); }
.navbar__brand span { color: var(--color-accent); } /* the ".", accented */
.brand-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--color-accent);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
}

/* Link list */
.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar__links a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.navbar__links a:hover,
.navbar__links a.is-active { color: var(--color-accent); }

/* "Publish" button sits in the nav — keep it looking like a button */
.navbar__links a.navbar__publish { color: #fff; padding: 0.5rem 1.15rem; }
.navbar__links a.navbar__publish:hover { color: #fff; }

/* Dropdown (Reviews > categories) */
.navbar__dropdown { position: relative; }
.navbar__dropdown-toggle {
  background: none;
  border: none;
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.navbar__dropdown-toggle:hover { color: var(--color-accent); }
.navbar__dropdown-menu {
  position: absolute;
  top: 150%;
  left: 0;
  min-width: 230px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-xs);
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition),
              visibility var(--transition);
}
.navbar__dropdown-menu li a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--color-text);
}
.navbar__dropdown-menu li a:hover { background: var(--color-surface-2); color: var(--color-accent); }
/* Open state is toggled by JS (click) or hover on desktop */
.navbar__dropdown:hover .navbar__dropdown-menu,
.navbar__dropdown.is-open .navbar__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hamburger button — hidden on desktop, shown on mobile */
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.navbar__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}

/* =====================================================================
   6. FOOTER  (dark, to ground the light page — markup injected by JS)
   ===================================================================== */
.footer {
  background: var(--color-dark);
  color: #d7d6d1;
  padding: var(--space-xl) 0 var(--space-md);
  margin-top: var(--space-xl);
}
.footer__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1.4fr 1fr 1fr;
}
.footer__brand-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.footer__brand-name span { color: var(--color-accent); }
.footer__tagline { color: #a7a59d; margin-top: var(--space-xs); }
.footer h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a7a59d;
  margin-bottom: var(--space-sm);
}
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 0.55rem; }
.footer__links a { color: #d7d6d1; font-size: 0.92rem; }
.footer__links a:hover { color: var(--color-accent); }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
  color: #8f8d85;
  font-size: 0.85rem;
}

/* =====================================================================
   7. HERO
   ===================================================================== */
.hero {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
  text-align: center;
}
.hero__inner { max-width: 780px; margin: 0 auto; }

/* Trust badge above the headline (green stars + line of text) */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow);
}
.hero__badge .js-stars { font-size: 16px; }

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: var(--space-sm);
}
.hero__title em { color: var(--color-accent); font-style: normal; }
.hero__intro {
  max-width: 620px;
  margin: 0 auto var(--space-md);
  color: var(--color-text-muted);
  font-size: 1.15rem;
}

/* Search bar — big rounded pill, Trustpilot-style */
.hero__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 580px;
  margin: 0 auto var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.35rem 0.35rem 1.1rem;
  box-shadow: var(--shadow);
}
.hero__search:focus-within { border-color: var(--color-accent); }
.hero__search-icon { font-size: 1.1rem; line-height: 1; color: var(--color-text-muted); }
.hero__search input {
  flex: 1;
  min-width: 0;             /* lets the input shrink on small screens */
  border: none;
  background: none;
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
  padding: 0.55rem 0.25rem;
  outline: none;
}
.hero__search .btn { flex: 0 0 auto; padding: 0.7rem 1.4rem; }
.hero__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* =====================================================================
   8. CATEGORY CHIPS + TILES
   ===================================================================== */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.category-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.category-chip .emoji { font-size: 1.1rem; }

/* =====================================================================
   9. REVIEW CARDS
   ===================================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-hover);
}
.card__image {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: var(--color-surface-2);
}
.card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: var(--space-xs);
}
.card__title { font-size: 1.15rem; margin-bottom: var(--space-xs); }
.card__title a { color: var(--color-heading); }
.card__title a:hover { color: var(--color-accent); }
.card__excerpt {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
  flex: 1;
}
.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.card__rating { font-size: 18px; } /* controls star-box size on cards */

/* =====================================================================
   10. STAR-RATING WIDGET
   --------------------------------------------------------------------
   The green "star boxes" are built by js/main.js as inline SVGs and
   dropped into any  <span class="js-stars" data-rating="4.5"></span>.
   Star SIZE is controlled by the font-size of the wrapper (1em boxes).
   ===================================================================== */
.js-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  vertical-align: middle;
}
.tp-star {
  width: 1em;
  height: 1em;
  display: block;
  border-radius: 3px;
  overflow: hidden;
  flex: 0 0 auto;
}
.tp-star__bg   { fill: var(--color-star-empty); }
.tp-star__fill { fill: var(--color-star); }
.tp-star__icon { fill: #ffffff; }

/* =====================================================================
   11. SINGLE REVIEW POST
   ===================================================================== */
.post { max-width: 820px; margin: 0 auto; }
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}
.post__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  background: var(--color-surface-2);
}
.post__body { font-size: 1.08rem; color: #2b2e29; }
.post__body h2 { margin-top: var(--space-lg); }
.post__body h3 { margin-top: var(--space-md); }
.post__body ul, .post__body ol { padding-left: 1.4rem; }
.post__body li { margin-bottom: 0.4rem; }

/* Rating block (big TrustScore-style widget) */
.rating {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
}
.rating__score {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--color-heading);
  line-height: 1;
  letter-spacing: -0.03em;
}
.rating__score small { font-size: 1rem; color: var(--color-text-muted); font-weight: 600; }
.rating__stars { font-size: 30px; }         /* controls star-box size here */
.rating__label { color: var(--color-text-muted); font-size: 0.95rem; margin-top: 0.35rem; }

/* Pros & cons — two columns */
.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.proscons__col {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}
.proscons__col--pros { background: rgba(0, 182, 122, 0.06); border-color: rgba(0,182,122,0.25); }
.proscons__col--cons { background: rgba(203, 47, 63, 0.05); border-color: rgba(203,47,63,0.2); }
.proscons__col h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
}
.proscons__col--pros h3 { color: var(--color-pro); }
.proscons__col--cons h3 { color: var(--color-con); }
.proscons__list { list-style: none; margin: 0; padding: 0; }
.proscons__list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}
.proscons__col--pros .proscons__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-pro);
  font-weight: 700;
}
.proscons__col--cons .proscons__list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: var(--color-con);
  font-weight: 700;
}

/* Affiliate CTA box */
.cta-box {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  margin: var(--space-lg) 0;
}
.cta-box h3 { margin-bottom: var(--space-xs); }
.cta-box p { color: var(--color-text-muted); margin-bottom: var(--space-md); }
.cta-box small {
  display: block;
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* =====================================================================
   12. ABOUT PAGE
   ===================================================================== */
.about-lead { max-width: 760px; }
.about-lead p { font-size: 1.12rem; color: var(--color-text); }
.values {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: var(--space-lg);
}
.value-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}
.value-card .emoji { font-size: 1.8rem; display: block; margin-bottom: var(--space-xs); }
.value-card h3 { font-size: 1.1rem; }
.value-card p { color: var(--color-text-muted); font-size: 0.92rem; margin: 0; }

/* =====================================================================
   13. CONTACT PAGE + FORM
   ===================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 700;
  font-size: 0.9rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.form-group textarea { resize: vertical; min-height: 140px; }
/* Inline validation / status message */
.form-status {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}
.form-status.is-success {
  display: block;
  background: rgba(26, 143, 76, 0.1);
  color: var(--color-pro);
  border: 1px solid rgba(26, 143, 76, 0.3);
}
.form-status.is-error {
  display: block;
  background: rgba(203, 47, 63, 0.08);
  color: var(--color-con);
  border: 1px solid rgba(203, 47, 63, 0.3);
}

/* Affiliate disclosure box */
.disclosure {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}
.disclosure h3 { font-size: 1.05rem; }
.disclosure p { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 0; }

/* =====================================================================
   14. UTILITIES
   ===================================================================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--color-text-muted); }
.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;
}

/* =====================================================================
   15. ANIMATIONS
   --------------------------------------------------------------------
   Motion is only applied when BOTH are true:
     (a) JS added `anim-ready` to <html> (set in each page's <head>), and
     (b) the visitor hasn't requested reduced motion.
   So if JS is off, nothing is hidden and the page shows normally.
   The reveal element list here must match REVEAL_SELECTOR in js/main.js.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* Scroll-reveal: start slightly lower + transparent, then ease into
     place when the element enters the viewport (JS adds .is-visible). */
  .anim-ready :is(
    .card, .section-head, .value-card, .proscons__col, .cta-box,
    .disclosure, .about-lead, .rating, .hero__badge, .hero__title,
    .hero__intro, .hero__search, .hero__actions, .categories,
    #contactForm, .post__hero
  ) {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--reveal-delay, 0s);
  }
  .anim-ready .is-visible {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Star boxes: the green fill sweeps in from the left, box by box. */
  .anim-ready .tp-star__fill {
    transform: scaleX(0);
    transform-box: fill-box;
    transform-origin: left center;
    transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
    transition-delay: var(--star-delay, 0s);
  }
  .anim-ready .js-stars.is-filled .tp-star__fill { transform: scaleX(1); }
}

/* --- Micro-interactions (fine for everyone; the reduced-motion block
       at the very bottom neutralises these for anyone who opts out) --- */

/* Card image gently zooms on hover */
.card__image { transition: transform 0.45s ease; }
.card:hover .card__image { transform: scale(1.05); }

/* Animated underline that grows in under nav links */
.navbar__links a { position: relative; }
.navbar__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.navbar__links a:hover::after,
.navbar__links a.is-active::after { transform: scaleX(1); }
/* the Publish button is not a text link — no sliding underline */
.navbar__links a.navbar__publish::after { display: none; }

/* Navbar gains a soft shadow once you start scrolling (JS toggles class) */
.navbar { transition: box-shadow 0.25s ease; }
.navbar.is-scrolled { box-shadow: 0 4px 20px rgba(18, 21, 17, 0.06); }

/* Buttons press down slightly on click */
.btn:active { transform: translateY(0); }

/* Mobile menu drop-in keyframes (used in the responsive section below) */
@keyframes menuDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* =====================================================================
   16. RESPONSIVE  (mobile overrides — anything under 820px)
   ===================================================================== */
@media (max-width: 820px) {
  /* --- Navbar collapses into a slide-down mobile menu --- */
  .navbar__toggle { display: block; }
  .navbar__links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    padding: var(--space-sm) var(--space-md);
    /* Hidden by default; JS toggles .is-open */
    display: none;
  }
  .navbar__links.is-open { display: flex; animation: menuDrop 0.25s ease; }
  .navbar__links li { width: 100%; }
  /* No sliding underline in the stacked mobile menu */
  .navbar__links a::after { display: none; }
  .navbar__links a { display: block; padding: 0.75rem 0; width: 100%; }

  /* Dropdown becomes an inline expanding list on mobile */
  .navbar__dropdown { width: 100%; }
  .navbar__dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 var(--space-sm);
    display: none;
  }
  .navbar__dropdown.is-open .navbar__dropdown-menu { display: block; }
  .navbar__dropdown-toggle { padding: 0.75rem 0; width: 100%; }

  /* Turn on hamburger "X" animation when menu open */
  .navbar__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar__toggle.is-open span:nth-child(2) { opacity: 0; }
  .navbar__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* --- Stack multi-column layouts --- */
  .proscons { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .footer__bottom { flex-direction: column; }
}

/* =====================================================================
   17. ADMIN PANEL  (styles for /admin/ and setup.php)
   ===================================================================== */
/* Small + danger button variants used in the admin */
.btn--sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn--danger { background: var(--color-con); color: #fff; }
.btn--danger:hover { background: #a52532; color: #fff; }

/* Select boxes reuse the input look */
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
}
.form-group select:focus { outline: none; border-color: var(--color-accent); }
.req { color: var(--color-con); }

/* Top bar */
.admin-bar {
  background: var(--color-dark);
  border-bottom: 1px solid #000;
}
.admin-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.admin-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
}
.admin-bar__brand:hover { color: #fff; }
.admin-bar__brand span { color: var(--color-accent); font-weight: 700; }
.admin-bar__nav { display: flex; align-items: center; gap: var(--space-sm); }
.admin-bar__nav a { color: #d7d6d1; font-size: 0.9rem; font-weight: 600; }
.admin-bar__nav a:hover { color: var(--color-accent); }
.admin-bar__nav .btn--outline { color: #fff; border-color: rgba(255,255,255,0.35); }
.admin-bar__nav .btn--outline:hover { border-color: #fff; color: #fff; }

/* Main area */
.admin-main { padding: var(--space-lg) 0 var(--space-xl); }
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.admin-head h1 { margin-bottom: 0.2rem; }

/* Centered card for login / setup */
.admin-login {
  max-width: 440px;
  margin: var(--space-lg) auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}
.admin-login h1 { font-size: 1.6rem; }

/* Visitor stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.admin-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
}
.admin-stat--hero {
  background: var(--color-dark);
  border-color: var(--color-dark);
}
.admin-stat__num {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-heading);
}
.admin-stat--hero .admin-stat__num { color: var(--color-accent); }
.admin-stat--hero .admin-stat__label { color: #a7a59d; }
.admin-stat__label {
  margin-top: 0.4rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Reviews table */
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}
.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { display: flex; gap: 0.5rem; align-items: center; }
.admin-empty {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
}

/* Form */
.admin-form { max-width: 760px; }
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-checkbox input { width: auto; }
@media (max-width: 640px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
}

/* =====================================================================
   18. REDUCED MOTION  (global safeguard — keep this LAST)
   Anyone with "reduce motion" enabled gets an essentially instant,
   motion-free experience across the whole site.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
