/*
Theme Name: Gaya
Description: Public site for Gaya, a professional network for olim in Israel. Brand tokens live in theme.json; event rendering lives in the gaya-events plugin.
Version: 0.3.0
Requires at least: 7.1
Requires PHP: 8.1
Text Domain: gaya
*/

/* Design tokens are declared in theme.json and exposed by WordPress as
   --wp--preset--color--* custom properties. This file only styles layout;
   colour values are never hard-coded here. */

:root {
  --gaya-max: 1120px;
  --gaya-gutter: clamp(1rem, 4vw, 2.5rem);
  --gaya-radius: 10px;
}

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

body {
  margin: 0;
  background: var(--wp--preset--color--offwhite);
  color: var(--wp--preset--color--ink);
  font-family: var(--wp--preset--font-family--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--wp--preset--font-family--heading);
  color: var(--wp--preset--color--olive);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

a { color: var(--wp--preset--color--sage); }
a:hover { color: var(--wp--preset--color--amber); }

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

.gaya-wrap {
  width: 100%;
  max-width: var(--gaya-max);
  margin-inline: auto;
  padding-inline: var(--gaya-gutter);
}

/* ── Header ─────────────────────────────────────────────── */

.gaya-header {
  background: var(--wp--preset--color--white);
  border-bottom: 1px solid var(--wp--preset--color--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.gaya-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  flex-wrap: wrap;
}

.gaya-logo img { max-height: 44px; width: auto; }
.gaya-logo {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 1.4rem;
  color: var(--wp--preset--color--sage);
  text-decoration: none;
  font-weight: 600;
}

.gaya-nav ul {
  display: flex;
  gap: clamp(0.75rem, 3vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.gaya-nav a {
  color: var(--wp--preset--color--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.gaya-nav a:hover,
.gaya-nav .current-menu-item > a { color: var(--wp--preset--color--sage); }

/* ── Buttons ────────────────────────────────────────────── */

.gaya-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--gaya-radius);
  background: var(--wp--preset--color--sage);
  color: var(--wp--preset--color--white);
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--wp--preset--color--sage);
  transition: background 0.15s ease, color 0.15s ease;
}

.gaya-btn:hover {
  background: var(--wp--preset--color--olive);
  border-color: var(--wp--preset--color--olive);
  color: var(--wp--preset--color--white);
}

.gaya-btn--accent {
  background: var(--wp--preset--color--amber);
  border-color: var(--wp--preset--color--amber);
}

.gaya-btn--accent:hover {
  background: var(--wp--preset--color--terracotta);
  border-color: var(--wp--preset--color--terracotta);
}

.gaya-btn--ghost {
  background: transparent;
  color: var(--wp--preset--color--sage);
}

.gaya-btn--ghost:hover { background: var(--wp--preset--color--sage); color: var(--wp--preset--color--white); }

/* ── Hero ───────────────────────────────────────────────── */

.gaya-hero {
  background: var(--wp--preset--color--white);
  padding-block: clamp(2rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--wp--preset--color--line);
}

.gaya-hero__inner {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

/* Single column on a phone, side by side once there is room. The text column
   is wider than the image: the words carry the message, the photo carries the
   proof. */
@media (min-width: 820px) {
  .gaya-hero__inner { grid-template-columns: 1.15fr 0.85fr; }
}

.gaya-hero__lede {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: #5b5b52;
  max-width: 34ch;
  margin: 0 0 1.75rem;
}

.gaya-hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0;
}

.gaya-hero__media {
  border-radius: var(--gaya-radius);
  overflow: hidden;
  /* Portrait originals would run the full height of the viewport if left
     alone; a fixed ratio keeps the fold intact on a laptop. */
  aspect-ratio: 4 / 5;
  background: var(--wp--preset--color--line);
}

.gaya-hero__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 819px) {
  .gaya-hero__media { aspect-ratio: 4 / 3; }
}

/* ── Photo strip ────────────────────────────────────────── */

.gaya-strip {
  background: var(--wp--preset--color--white);
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

.gaya-strip__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gaya-strip__grid li {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--gaya-radius);
  background: var(--wp--preset--color--line);
}

.gaya-strip__grid img { width: 100%; height: 100%; object-fit: cover; }

/* ── Prose ──────────────────────────────────────────────── */

.gaya-prose { max-width: 68ch; }
.gaya-prose p { margin-block: 0 1.1em; }

/* ── Sections ───────────────────────────────────────────── */

.gaya-section { padding-block: clamp(2.5rem, 8vw, 5rem); }
.gaya-section--tint { background: var(--wp--preset--color--white); }

.gaya-section__head { margin-bottom: 2rem; }
.gaya-section__head p { color: #5b5b52; margin: 0; max-width: 60ch; }

/* ── Event cards ────────────────────────────────────────── */

.gaya-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gaya-card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--gaya-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gaya-card__media {
  aspect-ratio: 16 / 9;
  background: var(--wp--preset--color--line);
  overflow: hidden;
}

.gaya-card__media img { width: 100%; height: 100%; object-fit: cover; }

.gaya-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }

.gaya-card__date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wp--preset--color--amber);
  font-weight: 700;
}

.gaya-card__title { margin: 0; font-size: 1.25rem; }
.gaya-card__title a { color: var(--wp--preset--color--olive); text-decoration: none; }
.gaya-card__title a:hover { color: var(--wp--preset--color--sage); }

.gaya-card__meta { font-size: 0.9rem; color: #5b5b52; margin: 0; }
.gaya-card__actions { margin-top: auto; padding-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.gaya-empty {
  padding: 2rem;
  border: 1px dashed var(--wp--preset--color--line);
  border-radius: var(--gaya-radius);
  color: #5b5b52;
  background: var(--wp--preset--color--white);
}

/* ── Single event ───────────────────────────────────────── */

.gaya-event__cover {
  border-radius: var(--gaya-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* The frame follows the photograph rather than the other way round: a portrait
   shot in a wide band loses most of itself before the focal point gets a say.
   Heights are capped so a tall photo cannot push the rest of the page off
   screen. */
/* One banner shape for every cover. A landscape photograph fills it; a tall one
   stands whole in the middle on a blurred enlargement of itself, so nothing is
   cropped and the frame still reads as deliberate rather than letterboxed. */
.gaya-event__cover--fill,
.gaya-event__cover--stand {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 460px;
  /* The height cap makes the banner narrower than the text column on a wide
     screen, so it is centred rather than left against one margin. */
  max-width: calc(460px * 16 / 9);
  margin-inline: auto;
  isolation: isolate;
}

.gaya-event__cover--stand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--gaya-cover-blur);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(0.85) brightness(0.72);
  transform: scale(1.15);
  z-index: -1;
}

.gaya-event__cover .gaya-cover__image { width: 100%; height: 100%; display: block; }
.gaya-event__cover--fill .gaya-cover__image { object-fit: cover; }
.gaya-event__cover--stand .gaya-cover__image { object-fit: contain; }

@media (max-width: 600px) {
  .gaya-event__cover--fill,
  .gaya-event__cover--stand { aspect-ratio: 4 / 3; }
}

@media (max-width: 600px) {
  .gaya-event__cover--portrait { aspect-ratio: 3 / 4; }
}

.gaya-event__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 0 1.5rem;
  margin: 0;
  border-bottom: 1px solid var(--wp--preset--color--line);
}

.gaya-event__facts div { min-width: 140px; }
.gaya-event__facts dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a7a70;
  margin-bottom: 0.15rem;
}
.gaya-event__facts dd { margin: 0; font-weight: 600; color: var(--wp--preset--color--olive); }

.gaya-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--wp--preset--color--gold);
  color: var(--wp--preset--color--olive);
}

.gaya-badge--past { background: var(--wp--preset--color--line); color: #5b5b52; }

/* ── Gallery ────────────────────────────────────────────── */

.gaya-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.gaya-gallery a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--wp--preset--color--line);
}

.gaya-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.gaya-gallery a:hover img { transform: scale(1.04); }

/* ── Header ─────────────────────────────────────────────── */

/* Inner pages wrap the shared landing header (inc/site-header.php) in this
   div. The header's own position:sticky cannot escape a wrapper that is
   exactly its size, so the wrapper carries the stickiness instead. */
.gaya-chrome { position: sticky; top: 0; z-index: 10; }
.admin-bar .gaya-chrome { top: 32px; }

/* ── Footer ─────────────────────────────────────────────── */

/* Shared footer (inc/site-footer.php) — the same bar on the homepage and on
   every other page. Colours are the contrast-safe shades from landing.css,
   written out because this stylesheet also serves pages without it. */
.site-footer {
  background: #577152;          /* sage-deep, the primary-button green: white 5.40:1 */
  color: #fff;
  padding: 40px 24px 32px;
  margin-top: 3rem;
  text-align: center;
  font-size: 15px;
}
.gaya-landing .site-footer { margin-top: 0; }
.site-footer__inner { max-width: 1280px; margin: 0 auto; display: grid; gap: 18px; justify-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.site-footer__social { display: flex; gap: 12px; }
.site-footer__social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
}
.site-footer__social a:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }

.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }

.site-footer__sign { margin: 0; color: #e5ede2; font-size: 13px; }   /* on sage-deep 4.51:1 */
.site-footer__sign span { margin-inline: 6px; }

/* ── Accessibility ──────────────────────────────────────── */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--wp--preset--color--amber);
  outline-offset: 2px;
}
