/*
Theme Name: Home Finds Curated
Theme URI: https://www.instagram.com/homefinds.curated/
Author: Liron
Description: Lightweight Amazon-finds catalog in a classic home-store layout. Add products under "Products" in the admin: title, short blurb (excerpt), featured image, Amazon link, category. Every product gets a number that matches the Instagram / Pinterest post.
Version: 1.7.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: homefinds
*/

:root {
  --brand: #b5603d;
  --brand-ink: #ffffff;
  --brand-soft: #f7e7dd;
  --bg: #f6f4f1;
  --surface: #ffffff;
  --ink: #232020;
  --muted: #6f6964;
  --line: #e7e2dc;
  --strip: #efedea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 32, 32, .05), 0 6px 18px rgba(35, 32, 32, .06);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; left: -9999px; }

/* ---------- Disclosure ---------- */
.disclosure { background: var(--ink); color: #f1ebe5; font-size: 12px; text-align: center; padding: 6px 16px; }

/* ---------- Header ---------- */
.site-header { background: var(--brand); color: var(--brand-ink); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding-top: 10px; padding-bottom: 10px; }
.brand { text-decoration: none; color: var(--brand-ink); display: inline-flex; align-items: center; }
.brand img { max-height: 46px; width: auto; }
.wordmark { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.wordmark-main { font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: .04em; position: relative; }
.wordmark-sub { font-size: 9.5px; letter-spacing: .5em; margin-top: 4px; padding-left: .5em; }
.header-search { display: flex; align-items: center; background: #fff; border-radius: 6px; overflow: hidden; max-width: 560px; width: 100%; justify-self: center; }
.header-search input { flex: 1; border: 0; outline: 0; padding: 10px 14px; font: inherit; color: var(--ink); min-width: 0; background: transparent; }
.header-search button { border: 0; background: transparent; color: var(--brand); padding: 0 14px; height: 40px; cursor: pointer; display: grid; place-items: center; }
.header-search svg { width: 18px; height: 18px; }
.social { display: flex; gap: 6px; }
.social a { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--brand-ink); text-decoration: none; background: rgba(255,255,255,.14); }
.social a:hover { background: rgba(255,255,255,.26); }
.social svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .site-header .wrap { grid-template-columns: 1fr auto; gap: 10px; }
  .header-search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
}

/* ---------- Category nav ---------- */
.catnav { background: var(--strip); border-bottom: 1px solid var(--line); }
.catnav .wrap { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catnav .wrap::-webkit-scrollbar { display: none; }
.catnav a { flex: none; text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 11px 12px; color: var(--ink); white-space: nowrap; }
.catnav a:hover, .catnav a.is-current { color: var(--brand); }
.catnav .home-link svg { width: 18px; height: 18px; display: block; }

/* ---------- Hero ---------- */
.hero { margin-top: 18px; border-radius: var(--radius); overflow: hidden; position: relative; background: var(--brand-soft); min-height: 300px; display: grid; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo-shade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0) 65%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; padding: 34px 40px; }
.hero-text .kicker { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 600; color: var(--brand); }
.hero h1 { font-family: var(--serif); font-size: clamp(30px, 4.6vw, 50px); line-height: 1.08; margin: 10px 0 12px; font-weight: 600; }
.hero p { margin: 0 0 20px; color: var(--muted); font-size: 16px; max-width: 460px; }
.hero.has-photo .hero-inner { grid-template-columns: 1fr; padding: 56px 44px; min-height: 360px; }
.hero.has-photo .hero-text, .hero.has-photo .kicker, .hero.has-photo p { color: #fff; }
.hero-collage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.hero-collage a { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 2 / 3; background: #fff; display: block; }
.hero-collage a:nth-child(2) { transform: translateY(-16px); }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; padding: 26px 20px 24px; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-collage a:nth-child(2) { transform: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: var(--brand-ink); text-decoration: none; border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 14px; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(.93); }
.btn svg { width: 16px; height: 16px; }
.btn-dark { background: var(--ink); }
.btn-small { padding: 5px 12px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; }

/* ---------- Sections ---------- */
.section { padding: 26px 0 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; }
.section-link { font-size: 13.5px; color: var(--brand); text-decoration: none; font-weight: 600; }

/* ---------- Category tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.tile { position: relative; display: block; text-decoration: none; padding: 16px 16px 12px; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; width: 82%; height: 88%; border: 2px solid var(--ink); pointer-events: none; }
.tile-collage { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-left: 10%; }
.tile-collage img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; border-radius: 6px; background: var(--brand-soft); }
.tile-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; }
.tile-name { font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: .04em; line-height: 1.1; background: var(--surface); padding-right: 8px; }

/* ---------- Today's finds (3 big picks) ---------- */
.section-date { color: var(--muted); font-size: 13.5px; text-transform: uppercase; letter-spacing: .12em; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; background: var(--surface); padding: 26px 26px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.pick { position: relative; padding: 14px 0 0 14px; }
.pick::before { content: ""; position: absolute; left: 0; top: 0; right: 14px; bottom: 26px; border: 2px solid var(--ink); pointer-events: none; }
.pick-frame { position: relative; display: block; text-decoration: none; }
.pick-media { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 8px; background: var(--brand-soft); box-shadow: 0 10px 24px rgba(35,32,32,.12); }
.pick-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform .4s ease; }
.pick:hover .pick-media img { transform: scale(1.04); }
.pick .card-num { top: 10px; left: 10px; }
.pick-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 14px; padding-right: 0; }
.pick-foot > div { background: var(--surface); padding-right: 10px; min-width: 0; }
.pick-cat { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--brand); font-weight: 700; }
.pick-title { margin: 2px 0 0; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.25; }
.pick-title a { text-decoration: none; }
.pick .btn-small { flex: none; position: relative; z-index: 1; }
@media (max-width: 860px) {
  .picks { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 18px; gap: 16px; }
  .pick { scroll-snap-align: start; }
}

/* ---------- Carousel ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail .card { scroll-snap-align: start; }
.rail .card-blurb { display: none; }
.rail .card-title { font-size: 15px; }
@media (max-width: 860px) { .rail { grid-auto-columns: calc((100% - 16px) / 2.3); } }
@media (max-width: 520px) { .rail { grid-auto-columns: 72%; } }

/* ---------- Search + filters (all finds) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 15px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.search-status { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; min-height: 1em; }

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 14px; padding: 12px 0 48px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.card { background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(35,32,32,.1); }
.card.is-flash { outline: 3px solid var(--brand); }
.card-media { aspect-ratio: 2 / 3; background: var(--brand-soft); overflow: hidden; display: block; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-num { position: absolute; top: 8px; left: 8px; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 12.5px var(--sans); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.card-title { font-size: 14px; line-height: 1.3; margin: 0; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { text-decoration: none; }
.card-blurb { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .btn { margin-top: auto; padding: 9px 12px; font-size: 13px; border-radius: 6px; }
@media (max-width: 520px) { .card-blurb { display: none; } .card .btn { font-size: 12px; } }
.empty { text-align: center; color: var(--muted); padding: 40px 0 80px; display: none; }

/* ---------- Single product ---------- */
.product-single { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 24px; margin-top: 18px; align-items: start; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 820px) { .product-single { grid-template-columns: 1fr; gap: 18px; padding: 14px; } }
.product-single .single-media { border-radius: 10px; overflow: hidden; background: var(--brand-soft); position: relative; }
.product-single h1 { font-family: var(--serif); font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; margin: 6px 0 12px; }
.product-single .lead { font-size: 17px; color: var(--muted); }
.product-single .btn { padding: 15px 28px; font-size: 16px; margin-top: 16px; border-radius: 8px; }
.product-single .note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.back { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- Page ---------- */
.page-content { max-width: 760px; margin: 18px auto; padding: 28px; background: var(--surface); border-radius: var(--radius); }
.page-content h1 { font-family: var(--serif); }

/* ---------- UX layer ---------- */
.btn-outline { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; filter: none; }
.pick-blurb { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; text-transform: none; letter-spacing: 0; font-weight: 400; }
.search-status { font-weight: 500; }
.empty { background: var(--surface); border-radius: var(--radius); padding: 36px 20px; margin: 12px 0 48px; box-shadow: var(--shadow); }
.empty h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; color: var(--ink); }
.empty p { margin: 0 0 16px; }
.empty .chips { justify-content: center; margin-bottom: 14px; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink); border-radius: 10px; box-shadow: 0 12px 30px rgba(35,32,32,.18); padding: 14px; display: none; z-index: 30; text-align: left; }
.suggest.is-open { display: block; }
.suggest-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.suggest .chips { flex-wrap: wrap; margin-bottom: 10px; }
.suggest .chip { text-decoration: none; }
.suggest-hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.header-search { position: relative; overflow: visible; }
.follow { background: var(--brand-soft); border-radius: var(--radius); padding: 30px 24px; text-align: center; margin-top: 10px; }
.follow h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 6px; }
.follow p { margin: 0 0 16px; color: var(--muted); }
.follow .btn + .btn { margin-left: 8px; }
.buy-bar { display: none; }
@media (max-width: 820px) {
  .buy-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 12px; align-items: center; background: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(35,32,32,.12); }
  .buy-bar span { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .buy-bar .btn { margin: 0; padding: 12px 18px; }
  .single-hf_product .site-footer { padding-bottom: 90px; }
}

/* ---------- About this find (long description) ---------- */
.about { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px 30px; margin: 18px 0 8px; }
.about .content { max-width: 760px; font-size: 16px; line-height: 1.7; }
.about h3 { font-size: 17px; margin: 22px 0 4px; }
.about h3:first-child { margin-top: 12px; }
.about p { margin: 0 0 8px; }
.about ul { margin: 6px 0 0; padding-left: 20px; }
.about li { margin: 4px 0; }
@media (max-width: 820px) { .about { padding: 20px 18px 22px; } }

/* ---------- Listings + pagination ---------- */
.listing-intro { color: var(--muted); margin: -6px 0 14px; }
a.chip { text-decoration: none; }
.chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip-count { opacity: .6; font-size: 12px; margin-left: 2px; }
.empty.is-visible { display: block; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: -18px 0 40px; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink); }
.pagination a.page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .dots { background: transparent; border: 0; min-width: 20px; padding: 0; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.room { display: flex; flex-direction: column; gap: 4px; padding: 20px 18px; border-radius: 12px; background: var(--brand-soft); text-decoration: none; font-family: var(--serif); font-size: 20px; font-weight: 600; transition: transform .2s ease, box-shadow .2s ease; }
.room:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.room span { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--brand); }
.browse-all { text-align: center; margin: 22px 0 6px; }

/* ---------- Footer links ---------- */
.footer-links { margin-top: 8px; font-size: 13px; }
.footer-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfc7c0; padding: 30px 0 40px; font-size: 13px; margin-top: 30px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: #cfc7c0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; }
