/*
Theme Name: Архигея — Хартия
Theme URI: https://archigeya-s.com
Author: Архигея – С ЕООД
Description: Тема за архитектурно студио „Архигея – С“. Светла, типографска, с акцент върху визуализациите. Двуезична (Polylang).
Version: 1.0.2
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: archigeya
*/

/* =====================================================================
   Tokens

   A single light palette, deliberately. This is a printed-matter direction —
   paper, ink, a blueprint blue — and a dark variant would undo the idea
   rather than extend it.
   ================================================================== */

:root {
  --paper:      #FBFAF8;
  --paper-warm: #F4F2EC;
  --ink:        #141414;
  --ink-soft:   #3A3A37;
  --mut:        #7A7872;
  --line:       #DEDBD3;
  --line-soft:  #ECE9E2;
  --acc:        #26456E;
  --acc-light:  #4E739F;

  --display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --body:    "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --gut:     clamp(20px, 5vw, 56px);
  --maxw:    1380px;
  --measure: 68ch;

  --t-fast: 160ms cubic-bezier(.4, 0, .2, 1);
  --t-med:  320ms cubic-bezier(.4, 0, .2, 1);
}

/* =====================================================================
   Base
   ================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--acc); color: var(--paper); }

.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; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* =====================================================================
   Layout
   ================================================================== */

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.wrap--narrow { max-width: 960px; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* =====================================================================
   Typography
   ================================================================== */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--acc);
  margin: 0;
}

.section-label {
  font-family: var(--body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  margin: 0;
}

.lede {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.link-underline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--acc);
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  display: inline-block;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.link-underline:hover { color: var(--ink); }

/* =====================================================================
   Header
   ================================================================== */

.site-header {
  position: sticky;
  top: 0;
  /* Above the mobile nav panel, so the wordmark and the close button stay
     visible and tappable while the menu is open. */
  z-index: 200;
  border-bottom: 1px solid var(--line);
}

/*
 * The frosted background lives on a pseudo-element, NOT on .site-header.
 *
 * backdrop-filter makes an element the containing block for any
 * position:fixed descendant. With it on the header, the mobile nav —
 * a fixed, inset:0 panel inside the header — resolved against the 76px
 * header box instead of the viewport, and opened as a thin strip.
 * Keeping the filter on ::before gives the same effect without capturing
 * the fixed positioning.
 */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  transition: min-height var(--t-med);
}
body[data-scrolled="1"] .site-header__inner { min-height: 60px; }

.brand {
  font-family: var(--display);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.brand img { max-height: 46px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 30px); }

/* wp_nav_menu is rendered with items_wrap '%3$s', so the items are bare <li>
   with no <ul> around them. Without this they keep list-item display and draw
   a marker in the middle of the navigation. */
.nav li { list-style: none; display: block; margin: 0; padding: 0; }
.nav a { display: block; }

.nav a {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mut);
  transition: color var(--t-fast);
  position: relative;
  padding-block: 6px;
}
.nav a:hover { color: var(--ink); }

.nav .current-menu-item > a,
.nav .current_page_item > a,
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/*
 * The wordmark and the controls must outrank the mobile nav panel.
 *
 * .site-header sets z-index 200 and so opens a stacking context; the nav's
 * z-index 150 is resolved *inside* it, against these siblings, not against
 * the page. Without an explicit z-index here the panel paints over the close
 * button and the menu cannot be dismissed.
 */
.brand,
.header-right { position: relative; z-index: 210; }

.header-right { display: flex; align-items: center; gap: 22px; }

.lang { display: flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.1em; }
.lang a { color: var(--mut); transition: color var(--t-fast); }
.lang a:hover { color: var(--ink); }
.lang__current { color: var(--acc); font-weight: 700; }
.lang__sep { color: var(--line); }

.nav-toggle { display: none; padding: 8px; margin-right: -8px; }
.nav-toggle span {
  display: block; width: 22px; height: 1.5px;
  background: var(--ink); margin: 5px 0;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =====================================================================
   Hero
   ================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
  padding-block: clamp(48px, 7vw, 84px) clamp(36px, 4.5vw, 56px);
}

.hero__title {
  font-size: clamp(34px, 5.4vw, 68px);
  margin-top: 22px;
}

.hero__side { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero__side p { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--mut); }

.band {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--paper-warm);
}
.band img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   Section head
   ================================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-block: clamp(42px, 6vw, 70px) 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(24px, 3vw, 34px);
}
.section-head__note { font-size: 10.5px; letter-spacing: 0.08em; color: var(--mut); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Project grid
   ================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: clamp(22px, 2.6vw, 34px);
  padding-bottom: clamp(48px, 6vw, 78px);
}

.card { display: block; }

.card__img {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--paper-warm);
  margin-bottom: 14px;
}
.card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms cubic-bezier(.2, .6, .2, 1), filter var(--t-med);
}
.card:hover .card__img img { transform: scale(1.035); }

.card__placeholder { display: block; width: 100%; height: 100%; background: var(--paper-warm); }

.card__title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.26;
  margin-bottom: 6px;
  transition: color var(--t-fast);
}
.card:hover .card__title { color: var(--acc); }

.card__meta {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Filters
   ================================================================== */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: clamp(22px, 3vw, 32px);
}

.filters a {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mut);
  border: 1px solid var(--line);
  padding: 8px 14px;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.filters a:hover { color: var(--ink); border-color: var(--mut); }
.filters a.is-active { background: var(--acc); border-color: var(--acc); color: var(--paper); font-weight: 600; }
.filters .count { opacity: .6; margin-left: 6px; font-variant-numeric: tabular-nums; }
.filters a.is-active .count { opacity: .75; }

/* =====================================================================
   Single project
   ================================================================== */

.project-head {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-block: clamp(38px, 5vw, 62px) clamp(26px, 3.4vw, 40px);
}

.project-head__title { font-size: clamp(28px, 4.2vw, 50px); margin-top: 18px; }

.specs { display: flex; flex-direction: column; gap: 0; margin: 0; }

.specs__row {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 16px;
  padding-block: 11px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.specs__row:last-child { border-bottom: 1px solid var(--line); }

.specs__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mut);
  padding-top: 2px;
}
.specs__value { color: var(--ink); }
.specs__value--year { font-variant-numeric: tabular-nums; }

/* Gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
  padding-bottom: clamp(40px, 5vw, 66px);
}
.gallery__item {
  margin: 0;
  overflow: hidden;
  background: var(--paper-warm);
  cursor: zoom-in;
}
.gallery__item img { width: 100%; height: auto; transition: opacity var(--t-fast); }
.gallery__item:hover img { opacity: .92; }

/* The first image runs full width — these are wide renders and a 3:2 crop
   in a narrow column wastes them. */
.gallery__item--lead { grid-column: 1 / -1; }

/* Project navigation */

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-block: clamp(24px, 3vw, 36px) clamp(48px, 6vw, 72px);
}
.project-nav a { max-width: 46%; }
.project-nav__dir {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 6px;
}
.project-nav__title { font-family: var(--display); font-size: 18px; line-height: 1.25; transition: color var(--t-fast); }
.project-nav a:hover .project-nav__title { color: var(--acc); }
.project-nav__next { text-align: right; margin-left: auto; }

/* =====================================================================
   Lightbox
   ================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; }

.lightbox__close {
  position: absolute;
  top: clamp(12px, 3vw, 26px);
  right: clamp(12px, 3vw, 26px);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 10px 14px;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--paper);
  font-size: 30px;
  line-height: 1;
  padding: 18px 20px;
  opacity: .75;
  transition: opacity var(--t-fast);
}
.lightbox__nav:hover { opacity: 1; }
.lightbox__prev { left: 4px; }
.lightbox__next { right: 4px; }
.lightbox__count {
  position: absolute;
  bottom: clamp(12px, 3vw, 24px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}

/* =====================================================================
   Pages / prose
   ================================================================== */

.page-head { padding-block: clamp(44px, 6vw, 76px) clamp(20px, 2.6vw, 30px); }
.page-head h1 { font-size: clamp(30px, 4.6vw, 56px); }

.prose { max-width: var(--measure); padding-bottom: clamp(48px, 6vw, 78px); font-size: 16px; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; line-height: 1.78; color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 { font-size: clamp(22px, 2.8vw, 32px); margin-top: 1.8em; }
.prose h3 { font-size: clamp(19px, 2.2vw, 24px); margin-top: 1.6em; }
.prose h4 { font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: .04em; margin-top: 1.4em; }
.prose a { color: var(--acc); border-bottom: 1px solid var(--line); transition: border-color var(--t-fast); }
.prose a:hover { border-color: var(--acc); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0; }
.prose li + li { margin-top: .5em; }
.prose img { margin-block: 1.6em; }
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.2em; }
.prose blockquote {
  margin: 1.8em 0; padding-left: 22px;
  border-left: 2px solid var(--acc);
  font-family: var(--display); font-size: 21px; line-height: 1.45; color: var(--ink);
}

/* Services list */

.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: clamp(48px, 6vw, 78px); }
.service { background: var(--paper); padding: clamp(20px, 2.4vw, 30px); }
.service__num { font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--acc); font-variant-numeric: tabular-nums; }
.service h3 { font-size: 20px; margin-block: 10px 8px; }
.service p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--mut); }

/* Team */

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(24px, 3vw, 40px); padding-bottom: clamp(48px, 6vw, 78px); }
.member h3 { font-size: 23px; margin-bottom: 4px; }
.member__role { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--acc); margin: 0 0 10px; font-weight: 600; }
.member__contact { font-size: 13.5px; color: var(--mut); margin: 0; }
.member__contact a { color: var(--acc); }

/* Contact */

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 68px); padding-bottom: clamp(48px, 6vw, 78px); align-items: start; }
.contact__block + .contact__block { margin-top: 26px; }
.contact__label { font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin: 0 0 5px; }
.contact__value { font-size: 17px; margin: 0; line-height: 1.5; }
.contact__value a { color: var(--acc); }

/* Partners */

.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: clamp(48px, 6vw, 78px); }
.partner { background: var(--paper); padding: 26px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; justify-content: space-between; min-height: 150px; }
.partner img { max-height: 52px; width: auto; filter: grayscale(1); opacity: .78; transition: filter var(--t-med), opacity var(--t-med); }
.partner:hover img { filter: grayscale(0); opacity: 1; }
.partner__name { font-size: 13px; font-weight: 600; }
.partner__name span { display: block; font-weight: 400; color: var(--mut); font-size: 12px; margin-top: 3px; }

/* =====================================================================
   Pagination
   ================================================================== */

.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: clamp(48px, 6vw, 78px); }
.pagination .page-numbers {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  font-size: 12.5px; color: var(--mut);
  font-variant-numeric: tabular-nums;
  transition: color var(--t-fast), border-color var(--t-fast);
  padding-inline: 10px;
}
.pagination .page-numbers:hover { color: var(--ink); border-color: var(--mut); }
.pagination .page-numbers.current { background: var(--acc); border-color: var(--acc); color: var(--paper); }

/* =====================================================================
   Footer
   ================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-warm);
  padding-block: clamp(40px, 5vw, 62px) 26px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(26px, 4vw, 56px);
  padding-bottom: clamp(28px, 3.6vw, 44px);
}

.footer-brand { font-family: var(--display); font-size: 22px; letter-spacing: .14em; margin-bottom: 10px; }
.footer-since { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }

.footer-col h4 {
  font-family: var(--body);
  font-size: 10px; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a, .footer-col p { font-size: 13.5px; color: var(--ink-soft); margin: 0; transition: color var(--t-fast); }
.footer-col a:hover { color: var(--acc); }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--mut);
}

/* =====================================================================
   404
   ================================================================== */

.error-404 { padding-block: clamp(70px, 12vw, 150px); text-align: center; }
.error-404 h1 { font-size: clamp(40px, 8vw, 90px); margin-bottom: 16px; }
.error-404 p { color: var(--mut); margin-bottom: 26px; }

/* =====================================================================
   Responsive
   ================================================================== */

@media (max-width: 1000px) {
  .hero, .project-head { grid-template-columns: 1fr; align-items: start; }
  .hero__title { margin-top: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }

  .nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    /* Clear the header, which sits above this panel. */
    padding: calc(76px + clamp(24px, 7vw, 44px)) var(--gut) var(--gut);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 150;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med);
  }

  body.nav-open .nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  body.nav-open { overflow: hidden; }

  .nav a {
    font-family: var(--display);
    font-size: clamp(26px, 8vw, 34px);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ink);
    padding-block: clamp(13px, 3.4vw, 18px);
    border-bottom: 1px solid var(--line-soft);
  }
  /* Covers both shapes: menu items are <li><a>, the no-menu fallback is bare <a>. */
  .nav > :last-child a,
  .nav > a:last-child { border-bottom: 0; }
  .nav .current-menu-item > a,
  .nav a[aria-current="page"] { color: var(--acc); font-weight: 400; }

  /* Stagger the items in behind the panel. */
  .nav > * { opacity: 0; transform: translateY(6px); }
  body.nav-open .nav > * {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 260ms ease, transform 260ms ease;
  }
  body.nav-open .nav > *:nth-child(1) { transition-delay: 40ms; }
  body.nav-open .nav > *:nth-child(2) { transition-delay: 80ms; }
  body.nav-open .nav > *:nth-child(3) { transition-delay: 120ms; }
  body.nav-open .nav > *:nth-child(4) { transition-delay: 160ms; }
  body.nav-open .nav > *:nth-child(5) { transition-delay: 200ms; }
  body.nav-open .nav > *:nth-child(6) { transition-delay: 240ms; }

  .header-right { gap: 14px; }
  .gallery { grid-template-columns: 1fr; }
  .project-nav a { max-width: 100%; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .specs__row { grid-template-columns: 1fr; gap: 2px; }
}

/* =====================================================================
   Motion / print
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .site-header, .site-footer, .project-nav, .filters, .lightbox { display: none !important; }
  body { background: #fff; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
