/*
Theme Name: The Synap
Theme URI: https://thesynap.com
Author: The Hyphn
Description: Clean, minimal theme for The Synap, where technology meets everyday life. India-first smartphone catalogue, compare pages and buyer guides.
Version: 0.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: thesynap
*/

/* ---------- Fonts (Gloock and Inter, both SIL OFL, self-hosted) ---------- */
@font-face {
  font-family: "Gloock";
  src: url("assets/fonts/Gloock-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens: palette from the logo artboards ---------- */
:root {
  --night:      #160204;   /* darkest, ink and dark surfaces */
  --wine:       #53041b;   /* deep burgundy */
  --burgundy:   #770429;   /* burgundy */
  --crimson:    #bb2649;   /* brand accent */

  --acc:        var(--crimson);   /* buttons, marks, fills */
  --acc-text:   #bb2649;          /* accent as text on the page background (6.0:1 on white) */
  --acc-ink:    #ffffff;          /* text on top of the accent */
  --acc-soft:   #fbebee;
  --ink:        var(--night);
  --ink-2:      #55464a;   /* 8.9:1 on white */
  --ink-3:      #7a6a6e;   /* 5.1:1 on white */
  --bg:         #ffffff;
  --bg-2:       #faf6f6;
  --bg-3:       #f1e9ea;
  --line:       rgba(22,2,4,0.10);
  --line-2:     rgba(22,2,4,0.18);
  --ok:         #0a7a4b;
  --warn:       #8a5a00;

  --display: "Gloock", "Inter", Georgia, "Times New Roman", serif;
  --font:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-display: clamp(36px, 3.8vw + 12px, 68px);
  --fs-h1: clamp(30px, 2.3vw + 12px, 46px);
  --fs-h2: clamp(22px, 1.2vw + 14px, 31px);
  --fs-h3: clamp(17px, 0.6vw + 14px, 21px);
  --fs-body: clamp(15px, 0.2vw + 14px, 17px);
  --fs-sm: 13.5px;
  --fs-label: 12px;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --r: 14px;
  --r-sm: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --acc-text: #ff6384;   /* 6.8:1 on the dark background */
    --acc-soft: #2d0812;
    --ink:      #fbf3f4;
    --ink-2:    #cdb8bc;
    --ink-3:    #a8939a;
    --bg:       #160204;
    --bg-2:     #200609;
    --bg-3:     #2c0b11;
    --line:     rgba(255,255,255,0.10);
    --line-2:   rgba(255,255,255,0.18);
    --ok:       #4fd69a;
    --warn:     #e0b050;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-body)/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.005em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
.sy-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sy-skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.sy-skip:focus { left: 8px; }
.sy-label { font: 600 var(--fs-label)/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sy-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; background: var(--acc); color: var(--acc-ink);
  font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 15px;
}
.sy-btn:hover { filter: brightness(1.08); }
.sy-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.sy-btn--ghost:hover { background: var(--bg-2); filter: none; }

/* ---------- Header ---------- */
.sy-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.sy-header__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; }
.sy-logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.sy-logo__svg { height: 26px; width: auto; display: block; }
.sy-nav { display: flex; gap: 6px; align-items: center; }
.sy-nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.sy-nav a:hover, .sy-nav a[aria-current="page"] { background: var(--bg-2); color: var(--ink); }
.sy-search { display: flex; }
.sy-search input { width: 200px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); font: inherit; font-size: 14px; }
.sy-search input::placeholder { color: var(--ink-3); }
.sy-menu { display: none; }
@media (max-width: 860px) {
  .sy-nav, .sy-search { display: none; }
  .sy-menu { display: block; position: relative; }
  .sy-menu summary { list-style: none; cursor: pointer; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; font-size: 14px; }
  .sy-menu summary::-webkit-details-marker { display: none; }
  .sy-menu__panel { position: absolute; right: 0; top: 52px; width: min(300px, 86vw); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px; display: grid; gap: 2px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
  .sy-menu__panel a { padding: 12px 14px; border-radius: 10px; text-decoration: none; font-weight: 500; }
  .sy-menu__panel a:hover { background: var(--bg-2); }
}

/* ---------- Hero / sections ---------- */
.sy-hero { padding: clamp(48px, 9vw, 112px) 0 clamp(36px, 6vw, 72px); }
.sy-hero h1 { font-size: var(--fs-display); max-width: 15ch; margin-bottom: .4em; }
.sy-hero p { font-size: clamp(17px, .5vw + 15px, 21px); color: var(--ink-2); max-width: 52ch; }
.sy-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.sy-section { padding: clamp(32px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.sy-section__head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.sy-section__head h2 { margin: 0; }
.sy-section__head a { color: var(--acc-text); font-weight: 600; text-decoration: none; font-size: 15px; white-space: nowrap; }
.sy-section__head a:hover { text-decoration: underline; }

/* ---------- Cards ---------- */
.sy-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sy-card { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; transition: border-color .15s, transform .15s; }
.sy-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.sy-card__img { aspect-ratio: 4/3; background: var(--bg-3); display: grid; place-items: center; overflow: hidden; }
.sy-card__img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.sy-card__body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.sy-card__brand { font: 500 var(--fs-label)/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sy-card__title { font-family: var(--display); font-size: 19px; line-height: 1.2; }
.sy-card__price { font-weight: 600; color: var(--acc-text); }
.sy-card__meta { font-size: var(--fs-sm); color: var(--ink-2); }
.sy-card--post .sy-card__img img { object-fit: cover; padding: 0; }

/* ---------- Phone page ---------- */
.sy-crumbs { font-size: var(--fs-sm); color: var(--ink-3); padding: 20px 0 0; }
.sy-crumbs a { color: var(--ink-2); text-decoration: none; }
.sy-crumbs a:hover { text-decoration: underline; }
.sy-phone { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 64px); padding: 28px 0 40px; align-items: center; }
.sy-phone__img { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); aspect-ratio: 1/1; display: grid; place-items: center; overflow: hidden; }
.sy-phone__img img { width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.sy-phone__price { font-family: var(--display); font-size: clamp(26px, 1.5vw + 18px, 36px); margin: 6px 0 0; }
.sy-phone__note { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 4px; }
.sy-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--acc-soft); color: var(--acc-text); font: 600 12px/1.4 var(--font); }
.sy-badge--upcoming { background: var(--bg-3); color: var(--warn); }
.sy-key { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.sy-key div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.sy-key dt { font: 500 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.sy-key dd { margin: 0; font-weight: 600; font-size: 15px; }
.sy-specs { margin: 8px 0 0; }
.sy-specs h2 { font-size: 20px; margin: 30px 0 10px; }
.sy-specs table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sy-specs th, .sy-specs td { text-align: left; padding: 11px 0; border-top: 1px solid var(--line); vertical-align: top; }
.sy-specs th { width: 36%; font-weight: 500; color: var(--ink-2); padding-right: 16px; }
.sy-source { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 22px; }
@media (max-width: 760px) { .sy-phone { grid-template-columns: 1fr; } .sy-specs th { width: 42%; } }

/* ---------- Catalogue filters ---------- */
.sy-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 8px 0 26px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.sy-filters label { display: grid; gap: 6px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.sy-filters select, .sy-filters input { padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; min-width: 150px; }

/* ---------- Articles / pages ---------- */
.sy-article { max-width: 720px; margin: 0 auto; padding: 36px 0 64px; }
.sy-article__meta { color: var(--ink-3); font-size: var(--fs-sm); margin-bottom: 24px; }
.sy-article img { border-radius: var(--r); }
.sy-article h2 { margin-top: 1.6em; }
.sy-article a { color: var(--acc-text); }
.sy-article table { width: 100%; border-collapse: collapse; }
.sy-article th, .sy-article td { padding: 10px; border: 1px solid var(--line); text-align: left; }
.sy-pagination { display: flex; gap: 8px; justify-content: center; margin: 36px 0; }
.sy-pagination a, .sy-pagination span { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); text-decoration: none; }
.sy-pagination .current { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }

/* ---------- Footer (always dark, white logo) ---------- */
.sy-footer { background: var(--night); color: #fbf3f4; padding: 56px 0 32px; margin-top: 56px; }
.sy-footer .sy-logo { color: #ffffff; }
.sy-footer .sy-logo__svg { height: 78px; }
.sy-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.sy-footer__tag { color: #cdb8bc; max-width: 34ch; margin-top: 16px; }
.sy-footer h3 { font: 600 var(--fs-label)/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: #a8939a; margin-bottom: 14px; }
.sy-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sy-footer a { text-decoration: none; color: #e6d6d9; }
.sy-footer a:hover { color: #ffffff; text-decoration: underline; }
.sy-footer__base { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.14); font-size: var(--fs-sm); color: #a8939a; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .sy-footer__grid { grid-template-columns: 1fr 1fr; } .sy-footer__grid > :first-child { grid-column: 1 / -1; } }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
