/* ============================================================
   Adveencha LLC — mobile-first stylesheet
   Bootstrap-like class names, no Bootstrap.
   Brand: navy #2c3b50 on white with near-black ink.
   Tokens (color, space, type) live in tokens.css, linked in
   head.php BEFORE this file.
   ============================================================ */

:root {
  --ink: var(--color-text);
  --paper: var(--color-bg);
  --canvas: var(--color-surface);
  --signal: var(--color-accent);
  --rule: 1px solid var(--color-divider);
  --rule-strong: 1px solid var(--ink);

  /* Breakpoints, for reference (media queries need literals)
     sm 576 · md 768 · lg 992 · xl 1200 */
  --gutter: var(--space-6);
  --container-pad: var(--space-4);
  --nav-h: 68px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Sticky footer: body is a full-height flex column (navbar, main, footer);
   main absorbs leftover space so the footer stays at the bottom. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img, svg, video { display: block; max-width: 100%; height: auto; }

/* ============================================================
   1. Containers
   ============================================================ */
.container,
.container-fluid {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container-narrow {
  width: 100%; margin-inline: auto;
  padding-inline: var(--container-pad);
  max-width: 640px;
}

/* ============================================================
   2. Grid — 12 columns, flexbox, mobile first
   ============================================================ */
.row { display: flex; flex-wrap: wrap; gap: var(--gutter); }
.row > * { flex: 0 0 100%; min-width: 0; }
.col-12 { flex: 0 0 100%; }

/* ============================================================
   3. Utilities
   ============================================================ */
.fs-sm { font-size: 15px; }
.text-muted { color: var(--color-neutral-600); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.1em; }
.fw-bold { font-weight: 600; }
.m-0 { margin: 0; }
.mt-3 { margin-top: var(--space-4); }
.mb-3 { margin-bottom: var(--space-4); }
.mt-4 { margin-top: var(--space-6); }
.mt-5 { margin-top: var(--space-8); }
.border-top { border-top: var(--rule); }
.py-4 { padding-block: var(--space-6); }

/* ============================================================
   4. Section rhythm — the whitespace lives here
   ============================================================ */
.section { padding-block: var(--space-8); }
.section + .section { border-top: var(--rule); }

.section-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 var(--space-6);
  color: var(--color-accent-700);
}

/* The one deliberate override back to serif -- see tokens.css's h1-h6
   rule, which is sans by default now. Used only on the homepage and
   about.php's hero, so it stays a rare, specific brand moment rather
   than the default look of every h1 on the site. */
.display-1 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: clamp(40px, 13vw, 108px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
}
.lead { font-size: 19px; line-height: 1.65; max-width: 40ch; color: var(--color-neutral-800); }

/* ============================================================
   5. Navbar — mobile: brand + toggle, panel opens below
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule);
}
.navbar > .container,
.navbar > .container-fluid {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--nav-h);
  flex-wrap: wrap;
}
/* Stacked lockup (mark above, name below) rather than side-by-side --
   the mark is literally the letter "A" in the same navy/serif style as
   the wordmark, so putting "Adveencha LLC" directly beside it read as a
   repeated letter. Stacking it as a small caption underneath keeps both
   without that visual echo. */
.navbar-brand {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  color: var(--ink); text-decoration: none; border-bottom: 0;
  padding-block: var(--space-1);
}
.navbar-brand:hover { color: var(--ink); }
.navbar-brand .mark { color: var(--signal); }
.navbar-brand img { display: block; height: 28px; width: auto; }
/* Just the size/spacing delta for the caption under the mark -- font
   family and weight come from .navbar-brand above, so admin-bar.php's
   plain (imageless) "Admin" span, which reuses .navbar-brand without a
   nested .navbar-brand-text, still gets the same heading font. */
.navbar-brand-text {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}

.navbar-toggler {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--color-neutral-300);
  padding: var(--space-2); cursor: pointer; color: var(--ink);
  width: 44px; min-height: 44px;
}
.navbar-toggler:hover { border-color: var(--signal); color: var(--color-accent-700); }
/* Hamburger by default; swaps to an X once the panel is open. Both are
   inline SVGs (see nav.php) so there's no icon font / sprite dependency
   -- the swap itself is pure CSS, keyed off the same aria-expanded
   attribute globals.js already sets for accessibility. */
.navbar-toggler .icon-close { display: none; }
.navbar-toggler[aria-expanded="true"] .icon-menu { display: none; }
.navbar-toggler[aria-expanded="true"] .icon-close { display: block; }

.navbar-collapse {
  flex-basis: 100%;
  display: none;
  border-top: var(--rule);
  padding-block: var(--space-2) var(--space-4);
}
.navbar-collapse.show { display: block; }
.navbar-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nav-link {
  display: block; padding: var(--space-3) 0; min-height: 44px;
  font-family: var(--font-sans); font-weight: 600;
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); text-decoration: none; border-bottom: 0;
}
.nav-link:hover,
.nav-link.active { color: var(--color-accent-700); }

/* Portfolio's submenu: a toggle button (not a link -- it has no page of
   its own, only its sub-pages) that expands an indented list beneath it
   on mobile, and a proper dropdown on desktop (see the 768px breakpoint
   below). globals.js toggles the .open class on click/tap on every
   screen size; desktop also gets a hover-only affordance, gated to
   pointer devices so a tap-to-open on a touchscreen doesn't get stuck
   "hovered" open. Collapsed (this rule) and closed (the .submenu rule
   right below) are both real display:none -- there's no state where the
   sub-links are visible without a click or a hover on .has-submenu. */
.nav-item.has-submenu { display: block; }
.nav-link-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; padding: var(--space-3) 0; min-height: 44px;
  font-family: var(--font-sans); font-weight: 600;
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink); text-align: left;
  background: transparent; border: 0; cursor: pointer;
}
.nav-link-toggle:hover,
.has-submenu.active > .nav-link-toggle { color: var(--color-accent-700); }
.nav-caret { font-size: 10px; line-height: 1; transition: transform 160ms linear; }
.has-submenu.open > .nav-link-toggle .nav-caret { transform: rotate(180deg); }

.submenu {
  list-style: none; margin: 0; padding: 0 0 var(--space-2) var(--space-4);
  display: none;
}
.has-submenu.open > .submenu { display: block; }
.submenu-link {
  display: block; padding: var(--space-2) 0; min-height: 40px;
  font-family: var(--font-sans); font-weight: 600;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-neutral-700); text-decoration: none; border-bottom: 0;
}
.submenu-link:hover,
.submenu-link.active { color: var(--color-accent-700); }

/* ============================================================
   6. Work / gallery
   ============================================================ */
.category-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-8); }

.gallery { display: grid; grid-template-columns: 1fr; gap: var(--space-8) var(--gutter); }
.work { display: block; text-decoration: none; color: inherit; border-bottom: 0; }
.work-figure {
  background: var(--canvas);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.work-figure img { width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms linear; }
.work:hover .work-figure img { opacity: 0.88; }
.work-title {
  font-family: var(--font-sans); font-weight: var(--font-heading-weight);
  font-size: 21px; line-height: 1.2; margin: var(--space-4) 0 var(--space-2);
}
.work-meta {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--color-neutral-600); margin: 0;
}
.work:hover .work-title { color: var(--signal); }

/* ============================================================
   7. Footer
   ============================================================ */
.footer {
  background: var(--color-neutral-900); color: var(--paper);
  padding-block: var(--space-8);
  margin-top: var(--space-8);
}
.footer a { color: var(--paper); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); }
.footer a:hover { color: var(--color-accent-300); border-color: var(--color-accent-300); }
/* Stacked lockup (mark above, name below), same reasoning as
   .navbar-brand in the header -- keeps the mark and "Adveencha LLC"
   from reading as a repeated letter side by side. */
.footer-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  color: var(--paper); text-decoration: none; border-bottom: 0;
}
.footer-brand:hover { color: var(--paper); }
.footer-brand img { display: block; max-height: 32px; max-width: 160px; width: auto; height: auto; }
.footer-brand-text {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.footer-title {
  font-family: var(--font-sans); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--color-accent-300);
  margin: 0 0 var(--space-4);
}
/* Same nav-style sans as the header links (.nav-link) -- these are the
   footer's own navigation, not reading copy. */
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); font-family: var(--font-sans); }
.footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  margin-top: var(--space-8); padding-top: var(--space-4);
  font-size: 13px; color: color-mix(in srgb, var(--paper) 65%, transparent);
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between;
}

/* ============================================================
   8. Breakpoints — sm 576 · md 768 · lg 992 · xl 1200
   ============================================================ */
@media (min-width: 576px) {
  .container { max-width: 540px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  :root { --container-pad: var(--space-6); --gutter: var(--space-8); --nav-h: 84px; }
  .container { max-width: 720px; }
  .section { padding-block: var(--space-10); }
  .lead { font-size: 21px; max-width: 44ch; }

  .col-md-3  { flex: 0 0 calc(3/12  * 100% - var(--gutter) *  9/12); }
  .col-md-4  { flex: 0 0 calc(4/12  * 100% - var(--gutter) *  8/12); }
  .col-md-5  { flex: 0 0 calc(5/12  * 100% - var(--gutter) *  7/12); }
  .col-md-6  { flex: 0 0 calc(6/12  * 100% - var(--gutter) *  6/12); }
  .col-md-7  { flex: 0 0 calc(7/12  * 100% - var(--gutter) *  5/12); }

  /* nav goes horizontal; toggler retires */
  .navbar-toggler { display: none; }
  .navbar-collapse { display: block !important; flex-basis: auto; border-top: 0; padding-block: 0; }
  .navbar-nav { flex-direction: row; align-items: center; gap: var(--space-6, 40px); }
  .nav-link { padding: 0; min-height: 0; }
  .navbar-brand img { height: 34px; }
  .navbar-brand-text { font-size: 12px; }

  /* Portfolio's submenu becomes a proper dropdown: flush against its
     toggle (no gap) so a mouse moving down from the label into the menu
     never leaves .has-submenu and loses :hover partway there. */
  .nav-item.has-submenu { position: relative; }
  .nav-link-toggle { width: auto; padding: 0; min-height: 0; }
  .submenu {
    position: absolute; top: 100%; left: 0; z-index: 30;
    min-width: 200px; margin: 0; padding: var(--space-2) 0;
    background: var(--paper); border: 1.5px solid var(--color-neutral-800);
    box-shadow: var(--shadow-md);
  }
  .submenu-link { padding: var(--space-2) var(--space-4); }
}

/* Hover-to-open, desktop only, and only on devices where hover means
   something (a real pointer) -- a tap on a touchscreen still uses the
   click-to-toggle .open class from globals.js either way. */
@media (min-width: 768px) and (hover: hover) {
  .has-submenu:hover > .submenu { display: block; }
}

@media (min-width: 992px) {
  .container { max-width: 960px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .section { padding-block: var(--space-12); }
}

@media (min-width: 1200px) {
  .container { max-width: 1120px; }
}

/* ============================================================
   9. Admin panel
   ============================================================ */
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding-block: var(--space-4); border-bottom: var(--rule); margin-bottom: var(--space-8);
}
.admin-bar .navbar-brand { margin-right: auto; font-size: 17px; }

/* Form group headings: the post form reuses .section-label for "Images",
   "Links", etc. In a form they need to read as dividers, not captions. */
form .section-label {
  font-size: 13px;
  padding-top: var(--space-6);
  border-top: var(--rule);
  margin-bottom: var(--space-3);
}
form .section-label + .fs-sm { margin-bottom: var(--space-4); max-width: 62ch; }

/* Repeater rows (image + link builders) sit in their own tinted band so
   each row reads as one unit instead of a loose field pile. */
.repeater-row {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end;
  padding: var(--space-4); margin-bottom: var(--space-3);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-400);
}
.repeater-row .field { flex: 1 1 220px; margin-bottom: 0; }
.repeater-row .field-file { flex: 1 1 100%; }
.repeater-row .input { background: var(--color-bg); }
.repeater-row .thumb { align-self: center; }
.repeater-row .field > .radio,
.repeater-row .field > .checkbox { margin-bottom: var(--space-2); }

.form-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-top: var(--space-8); padding-top: var(--space-6);
  border-top: var(--rule-strong);
}

.thumb { display: block; width: 56px; height: 70px; object-fit: cover; background: var(--canvas); border: 1px solid var(--color-neutral-300); }

/* Dashboard row actions: Edit and its Delete <form> sit side by side */
.table td form { display: inline; margin: 0; }
.table td .btn { vertical-align: middle; }
.table td .btn + form { margin-left: var(--space-2); }

/* ============================================================
   10. Alerts
   ============================================================ */
.alert { padding: var(--space-4); margin-top: var(--space-6); border-left: 3px solid var(--ink); background: var(--color-neutral-100); }
.alert-error { border-color: var(--color-neutral-900); background: var(--color-neutral-200); }
.alert-success,
.alert-info { border-color: var(--signal); background: var(--color-accent-100); }

/* ============================================================
   11. Work detail — public/work.php
   ============================================================ */
.work-detail-images { display: flex; flex-direction: column; gap: var(--space-6); }
.work-detail-images img { width: 100%; height: auto; background: var(--canvas); }
.work-detail-body p { max-width: 62ch; }
.work-detail-links { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-6); }
.work-detail-links .btn { align-self: flex-start; }
.work-video { position: relative; width: 100%; max-width: 62ch; aspect-ratio: 16 / 9; }
.work-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================
   12. Clients — public/index.php's "Clients" section
   ============================================================ */
/* A plain horizontal, wrapping row -- deliberately low-hierarchy (no
   card borders/boxes around each mark) so it reads as one quiet "worked
   with" strip rather than a grid of six equally-weighted tiles. */
.clients-grid {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: var(--space-6);
}
.client-logo {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; border-bottom: 0;
}
.client-logo img {
  /* min-height (not just a max) so a client's small/low-res mark still
     reads clearly in the strip -- width stays auto off that height, so
     nothing stretches or distorts; max-height/max-width just stop an
     unusually large source file from throwing off the row. */
  min-height: 44px; max-height: 60px; width: auto; max-width: 170px;
  filter: grayscale(1); opacity: 0.6;
  transition: filter 160ms linear, opacity 160ms linear;
}
a.client-logo:hover img { filter: grayscale(0); opacity: 1; }
.client-logo-static { cursor: default; }

@media (min-width: 768px) {
  .client-logo img { min-height: 52px; max-height: 68px; max-width: 190px; }
}

/* ============================================================
   13. About / Resume — public/about.php
   ============================================================ */
/* The resume (Focus/Experience/Education/Qualifications) sits inside
   about.php, below the studio intro, but needs to read as its own
   grouped block rather than more of the same page -- the way
   .repeater-row already tints a group of related admin fields for the
   same reason (see §9). A barely-there --color-surface fill (same tint
   used for image mats) plus a firm --rule-strong edge top and bottom
   mark the boundary clearly without introducing rounded corners or a
   shadow, which the rest of the site never uses. The .section children
   inside keep their normal padding/divider rhythm (.section + .section
   from §4 still applies here -- sibling selectors don't care that
   there's a wrapping element in between), so nothing about their own
   spacing needed to change. */
.resume-panel {
  background: var(--color-surface);
  border-top: var(--rule-strong);
  border-bottom: var(--rule-strong);
}
