/*
Theme Name: Used Greenhouse Supply & Equipment
Theme URI: https://example.com/
Author: SEOBANK
Description: Lightweight custom theme for a used greenhouse equipment dealer. Inventory-driven, enquiry-led, no page builder. Modelled on the structure of ctcequipment.ca.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GPL v2 or later
Text Domain: ugse
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --ink:        #14181B;
  --ink-2:      #1D2328;
  --ink-3:      #2A3238;
  --accent:     #2F8F53;
  --accent-dk:  #226B3E;
  --accent-lt:  #8FD6A8;
  --paper:      #FFFFFF;
  --mist:       #F4F6F5;
  --slate:      #56635E;
  --line:       rgba(20, 24, 27, .12);
  --line-dk:    rgba(255, 255, 255, .14);
  --amber:      #B45309;
  --ochre:      #A85E0D;
  --danger:     #9F1239;

  --wrap: 1200px;
  --radius: 6px;

  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dk); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .005em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1rem; text-wrap: pretty; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 12px; top: 12px; z-index: 999; background: #fff;
  padding: .6rem 1rem; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ==========================================================================
   Buttons & shared bits
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem; border: 0; border-radius: var(--radius);
  font-family: var(--body); font-size: .9375rem; font-weight: 600; line-height: 1;
  cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dk); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-dk); }
.btn--onDark { background: var(--accent-lt); color: var(--ink); }
.btn--onDark:hover { background: #fff; color: var(--ink); }
.btn--outlineDark { background: transparent; color: #fff; border: 1px solid var(--line-dk); }
.btn--outlineDark:hover { border-color: var(--accent-lt); color: var(--accent-lt); }

.eyebrow {
  font-family: var(--body); font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 .65rem;
}
.section { padding: 72px 0; }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section__head { max-width: 640px; margin-bottom: 40px; }
.section__head h2 { font-size: 2.25rem; text-transform: uppercase; }
.section__head p { color: var(--slate); font-size: 1.0625rem; margin: .75rem 0 0; }
.section--ink .section__head p { color: rgba(255,255,255,.7); }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar {
  background: var(--ink); color: rgba(255,255,255,.75);
  font-size: .8125rem; border-bottom: 1px solid var(--line-dk);
}
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 8px 20px; }
.topbar a { color: rgba(255,255,255,.85); }
.topbar a:hover { color: var(--accent-lt); }
.topbar__hours { display: flex; gap: 18px; flex-wrap: wrap; }

.masthead { background: var(--ink-2); position: sticky; top: 0; z-index: 50; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand__mark { flex: 0 0 auto; }
.brand__name {
  font-family: var(--display); font-size: 1.3rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; line-height: 1.05;
}
.brand__name span { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .16em; color: var(--accent-lt); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: block; padding: .6rem .85rem; border-radius: var(--radius);
  color: rgba(255,255,255,.85); font-size: .9375rem; font-weight: 500;
}
.nav a:hover, .nav a[aria-current] { background: rgba(255,255,255,.08); color: #fff; }
.masthead__cta { display: flex; align-items: center; gap: 14px; }
.masthead__phone { color: #fff; font-family: var(--display); font-size: 1.35rem; font-weight: 700; white-space: nowrap; }
.masthead__phone:hover { color: var(--accent-lt); }

.menu-toggle {
  display: none; width: 44px; height: 40px; border: 1px solid var(--line-dk);
  background: transparent; border-radius: var(--radius); color: #fff; cursor: pointer;
}
@media (max-width: 960px) {
  .nav, .masthead__phone { display: none; }
  .menu-toggle { display: grid; place-items: center; }
  .masthead__nav--open { display: block; }
  .mobile-nav { background: var(--ink-2); border-top: 1px solid var(--line-dk); padding: 12px 0; }
  .mobile-nav a { display: block; padding: .7rem 20px; color: #fff; }
  .mobile-nav a:hover { background: rgba(255,255,255,.07); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-3) 100%);
  color: #fff; padding: 84px 0 76px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); text-transform: uppercase; max-width: 900px; }
.hero__lede { max-width: 640px; margin: 20px 0 0; font-size: 1.125rem; color: rgba(255,255,255,.78); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line-dk); }
.hero__stat b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 700; color: var(--accent-lt); }
.hero__stat span { font-size: .875rem; color: rgba(255,255,255,.65); }

/* ==========================================================================
   Search bar
   ========================================================================== */
.searchbar { background: var(--accent-dk); padding: 20px 0; }
.searchbar form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.searchbar label { color: #fff; font-weight: 600; font-size: .9375rem; white-space: nowrap; }
.searchbar input[type=search], .searchbar select {
  flex: 1 1 200px; min-width: 0; padding: .7rem .9rem; border: 0;
  border-radius: var(--radius); font: inherit; font-size: .9375rem; background: #fff; color: var(--ink);
}

/* ==========================================================================
   Equipment grid & cards
   ========================================================================== */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease;
}
.card:hover { border-color: rgba(47,143,83,.45); box-shadow: 0 10px 30px -16px rgba(20,24,27,.28); transform: translateY(-2px); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--mist); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card__cat { font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.card__title { font-size: 1.25rem; text-transform: uppercase; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--accent-dk); }
.card__specs { list-style: none; margin: 12px 0 0; padding: 0; font-size: .8125rem; color: var(--slate); display: grid; gap: 3px; }
.card__specs b { color: var(--ink); font-weight: 600; }
.card__foot { margin-top: auto; padding-top: 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__price { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.card__price small { font-family: var(--body); font-size: .6875rem; font-weight: 600; color: var(--slate); letter-spacing: .04em; }
.card__price--call { font-size: 1.1rem; color: var(--accent-dk); }
.card__link { font-size: .875rem; font-weight: 600; }

/* Status badge */
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: .3rem .6rem; border-radius: 3px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.badge--sold { background: var(--danger); }
.badge--pending { background: var(--amber); }
.card--sold .card__media img { filter: grayscale(1); opacity: .65; }

/* Placeholder artwork when no photo is attached */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--ink-3), var(--ink));
  color: rgba(255,255,255,.5); text-align: center; padding: 16px;
}
.ph b { font-family: var(--display); font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.ph span { font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; }

/* ==========================================================================
   Category tiles
   ========================================================================== */
.cat {
  display: block; padding: 22px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s ease, transform .2s ease;
}
.cat:hover { border-color: var(--accent); transform: translateY(-2px); }
.cat h3 { font-size: 1.15rem; text-transform: uppercase; color: var(--ink); }
.cat p { font-size: .875rem; color: var(--slate); margin: 8px 0 0; }
.cat__count { display: inline-block; margin-top: 12px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ==========================================================================
   Archive toolbar / filters
   ========================================================================== */
.page-head { background: var(--ink); color: #fff; padding: 52px 0 44px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; }
.page-head p { color: rgba(255,255,255,.7); margin: 12px 0 0; max-width: 620px; }
.crumbs { font-size: .8125rem; color: rgba(255,255,255,.6); margin-bottom: 16px; }
.crumbs a { color: rgba(255,255,255,.8); }
.crumbs span { opacity: .5; margin: 0 .4rem; }

.filters { border-bottom: 1px solid var(--line); background: var(--mist); padding: 18px 0; }
.filters__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-block; padding: .45rem .85rem; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; font-size: .8125rem; font-weight: 500; color: var(--slate);
}
.chip:hover { border-color: var(--accent); color: var(--accent-dk); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip b { font-weight: 700; }

.resultbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.resultbar p { margin: 0; color: var(--slate); font-size: .9375rem; }
.resultbar strong { color: var(--ink); }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 44px; }
.pagination .page-numbers {
  display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .7rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); font-size: .9375rem; font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent-dk); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots:hover { border-color: var(--line); color: var(--ink); }

/* ==========================================================================
   Single equipment
   ========================================================================== */
.single-eq { padding: 44px 0 72px; }
.single-eq__layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .single-eq__layout { grid-template-columns: 1fr; } }

.gallery__main { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--mist); }
/* Contain, not cover: stock photos are often portrait phone shots and the
   readable part is usually a rating label. Cropping it defeats the point. */
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs a { display: block; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 10px; }
.gallery__thumbs img { border: 1px solid var(--line); border-radius: 4px; aspect-ratio: 1; object-fit: cover; }

.eq-title { font-size: clamp(1.9rem, 4vw, 2.6rem); text-transform: uppercase; margin-bottom: 8px; }
.eq-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: .875rem; color: var(--slate); margin-bottom: 22px; }
.eq-meta .badge { position: static; }

.pricebox { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--mist); }
.pricebox__amount { font-family: var(--display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--ink); }
.pricebox__amount small { font-family: var(--body); font-size: .8125rem; font-weight: 600; color: var(--slate); letter-spacing: .04em; }
.pricebox__call { font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--accent-dk); text-transform: uppercase; }
.pricebox__actions { display: grid; gap: 10px; margin-top: 18px; }
.pricebox__note { font-size: .8125rem; color: var(--slate); margin: 14px 0 0; }

.spectable { width: 100%; border-collapse: collapse; font-size: .9375rem; margin: 0 0 1.5rem; }
.spectable th, .spectable td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.spectable th { width: 40%; color: var(--slate); font-weight: 500; background: rgba(20,24,27,.02); }
.spectable td { font-weight: 600; }

.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--ink); }
.prose h2 { font-size: 1.6rem; text-transform: uppercase; margin: 2.25rem 0 .6rem; }
.prose h3 { font-size: 1.25rem; margin: 1.75rem 0 .5rem; }
.prose ul li { margin-bottom: .4rem; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form__row { grid-template-columns: 1fr; } }
.form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .35rem; }
.form .req { color: var(--accent); }
.form input, .form select, .form textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line);
  border-radius: var(--radius); font: inherit; font-size: .9375rem; background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,143,83,.14);
}
.form textarea { resize: vertical; min-height: 120px; }
.form__hp { position: absolute; left: -9999px; }

.notice { padding: 14px 16px; border-radius: var(--radius); font-size: .9375rem; margin-bottom: 20px; }
.notice--ok { background: rgba(47,143,83,.12); border: 1px solid rgba(47,143,83,.35); color: var(--accent-dk); }
.notice--err { background: rgba(159,18,57,.08); border: 1px solid rgba(159,18,57,.3); color: var(--danger); }

/* ==========================================================================
   Trust pillars / services
   ========================================================================== */
.pillars { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pillar__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--radius); background: rgba(47,143,83,.12); color: var(--accent); margin-bottom: 16px; }
.section--ink .pillar__icon { background: rgba(143,214,168,.14); color: var(--accent-lt); }
.pillar h3 { font-size: 1.3rem; text-transform: uppercase; margin-bottom: 8px; }
.pillar p { color: var(--slate); margin: 0; }
.section--ink .pillar p { color: rgba(255,255,255,.7); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 60px 0 0; font-size: .9375rem; }
.footer a { color: rgba(255,255,255,.8); }
.footer a:hover { color: var(--accent-lt); }
.footer__cols { display: grid; gap: 36px; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }
@media (max-width: 860px) { .footer__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__cols { grid-template-columns: 1fr; } }
.footer h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer address { font-style: normal; line-height: 1.7; }
.footer__legal {
  margin-top: 48px; padding: 20px 0; border-top: 1px solid var(--line-dk);
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  font-size: .8125rem; color: rgba(255,255,255,.5);
}

/* ==========================================================================
   Announcement ticker (public) and placeholder reminder (admins only)
   ========================================================================== */
.ticker {
  background: var(--ochre);
  color: #fff;
  overflow: hidden;
  position: relative;
  /* Fade the message in and out at both edges rather than cutting it dead. */
  mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ugse-ticker 46s linear infinite;
}

/* Let a reader stop the text to finish reading it. */
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track { animation-play-state: paused; }

.ticker__list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticker__list li {
  display: flex;
  align-items: center;
  padding: 9px 0;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
}

/* Separator dot picks up the brand green, tying the bar to the logo. */
.ticker__list li::after {
  content: '';
  width: 5px;
  height: 5px;
  margin: 0 30px;
  border-radius: 50%;
  background: var(--accent-lt);
  flex: 0 0 auto;
}

@keyframes ugse-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.devbar {
  margin: 0; background: var(--amber); color: #fff; text-align: center;
  padding: 6px 20px; font-size: .75rem; font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }

  /* A 0.01ms infinite loop would strobe, so stop the ticker completely and
     show one centred, readable copy of the message instead. */
  .ticker { mask-image: none; -webkit-mask-image: none; }
  .ticker__track { animation: none !important; width: 100%; justify-content: center; }
  .ticker__list:last-child { display: none; }
  .ticker__list li:not(:first-child) { display: none; }
  .ticker__list li::after { display: none; }
}
