/*
 * The landing page of Közhír (kozhirportal.hu). Plain CSS, no build. The tokens and patterns are copied from the
 * public site (web/src/app/(frontend)/styles/, docs/DESIGN.md): forest green and mustard, Source Serif 4 headings,
 * Public Sans text, the same contrast pairs. When the site tokens change, follow them here by hand (docs/DESIGN.md,
 * „Bemutató oldal”).
 */

/* Self-hosted variable fonts (fontsource, SIL OFL 1.1, fonts/OFL-*.txt): no request to another server. */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/public-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/public-sans-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens (docs/DESIGN.md, „Színek”, „Tipográfia”, „Térközök”) ---------- */

:root {
  color-scheme: light;

  --color-primary: #1b4332;
  --color-secondary: #c69c30;
  --color-on-secondary: #14231b;
  --color-primary-strong: color-mix(in oklab, var(--color-primary), black 22%);
  --color-secondary-strong: color-mix(in oklab, var(--color-secondary), black 12%);
  --color-text: #17241d;
  --color-text-muted: #47554d;
  --color-page: #f5f7f5;
  --color-background: #ffffff;
  --color-surface: #ebf1ed;
  --color-border: #d3ddd7;
  --color-heading: var(--color-primary);
  --color-link: var(--color-primary);
  --color-highlight: #fff4df;
  --color-highlight-border: #8a5a00;
  --color-focus: #14231b;
  --color-focus-on-dark: #ffd866;

  --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-size-body: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --font-size-small: 1rem;
  --font-size-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --font-size-h2: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --font-size-h3: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --font-size-display: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  --line-height-body: 1.6;
  --line-height-heading: 1.18;
  --measure: 70ch;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --section-gap: clamp(2.5rem, 1.75rem + 3vw, 4rem);
  --panel-padding: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  --card-padding: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --container-width: 76rem;
  --radius-small: 0.5rem;
  --radius: 0.75rem;
  --radius-large: 1.25rem;
  --shadow-raised: 0 1px 2px rgb(20 35 27 / 0.06), 0 12px 32px rgb(20 35 27 / 0.1);
  --focus-ring: 3px solid var(--color-focus);
  --target-size: 44px;
}

@media (pointer: fine) {
  :root {
    --target-size: 40px;
  }
}

@supports (color: oklch(from red l c h)) {
  :root {
    --color-link: oklch(from var(--color-primary) min(l, 0.42) c h);
    --color-heading: oklch(from var(--color-primary) min(l, 0.42) c h);
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-padding-block-start: var(--space-4);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-size-adjust: from-font;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-page);
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  letter-spacing: -0.005em;
  color: var(--color-heading);
  text-wrap: balance;
  margin-block: 0;
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: 600;
}

p,
li,
dd {
  text-wrap: pretty;
}

p {
  margin-block: 0;
  max-inline-size: var(--measure);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.15em;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

.on-dark {
  --color-focus: var(--color-focus-on-dark);
  --color-link: #ffffff;
  --color-heading: #ffffff;
  color: #ffffff;
}

.container {
  inline-size: min(100% - 2 * var(--space-3), var(--container-width));
  margin-inline: auto;
}

.stack > * + * {
  margin-block-start: var(--space-3);
}

.lead {
  font-size: var(--font-size-lead);
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-3);
  inset-block-start: -100%;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--color-background);
  border-radius: var(--radius-small);
}

.skip-link:focus {
  inset-block-start: var(--space-2);
}

/* ---------- Buttons (components.css: .button, .button--accent, .button--ghost, .button-group) ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: 48px;
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--color-link);
  border-radius: var(--radius-small);
  background: var(--color-link);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.button--accent {
  border-color: var(--color-secondary);
  background: var(--color-secondary);
  color: var(--color-on-secondary);
}

.button--accent:hover {
  border-color: var(--color-secondary-strong);
  background: var(--color-secondary-strong);
}

.button--ghost,
.button--ghost:hover {
  border-color: currentColor;
  color: #ffffff;
  background: rgb(0 0 0 / 0.3);
}

.button--ghost:hover {
  background: rgb(0 0 0 / 0.5);
}

/* Opaque, on the image viewer (the "Bezárás" button of ImageViewer): white on --color-text. */
.button--dark,
.button--dark:hover {
  border-color: #ffffff;
  background: var(--color-text);
  color: #ffffff;
}

.button--dark:hover {
  background: var(--color-primary);
}

.button--large {
  min-block-size: clamp(48px, 2.5rem + 1vw, 56px);
  padding-inline: clamp(1.125rem, 0.9rem + 1vw, 1.5rem);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

@media (max-width: 39.99rem) {
  .button-group:has(> :nth-child(2)) {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Header and footer ---------- */

.site-header {
  background: var(--color-primary);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-size);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-secondary);
  text-decoration-thickness: 3px;
}

@media (max-width: 39.99rem) {
  .site-nav {
    gap: 0 var(--space-3);
  }
}

.site-footer {
  background: var(--color-primary);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-5);
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-size);
  font-weight: 600;
}

/* ---------- Hero: the home page of a town, on a desktop and a phone ---------- */

.hero {
  background: var(--color-primary);
  /* The screenshots run down into the next section: a strip of the page colour under the green. */
  background-image: linear-gradient(to top, var(--color-page) var(--space-6), transparent var(--space-6));
  padding-block-start: clamp(var(--space-4), 4vw, var(--space-6));
}

.hero__inner {
  display: grid;
  gap: var(--space-5);
}

.hero h1 {
  font-size: var(--font-size-display);
}

.hero__text {
  display: grid;
  gap: var(--space-4);
  align-content: center;
}

.hero__text .lead {
  color: rgb(255 255 255 / 0.92);
}

/* The desktop shot with the phone shot overlapping its lower right corner. */
.hero__shots {
  position: relative;
  padding-inline-end: clamp(3rem, 12%, 7rem);
  padding-block-end: var(--space-3);
}

.hero__desktop,
.hero__phone {
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  background: var(--color-background);
}

.hero__desktop {
  inline-size: 100%;
}

.hero__phone {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: 0;
  inline-size: clamp(6.5rem, 26%, 11rem);
  border: 4px solid var(--color-text);
  border-radius: 1.25rem;
}

@media (min-width: 64rem) {
  .hero__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .hero__text {
    padding-block-end: calc(var(--space-6) + var(--space-4));
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-gap);
}

.section--tinted {
  background: var(--color-background);
  border-block: 1px solid var(--color-border);
}

.section__intro {
  display: grid;
  gap: var(--space-3);
  margin-block-end: var(--space-5);
}

.section__intro p {
  color: var(--color-text-muted);
}

/* Title (or text) on the left, content on the right from 56rem. */
.split {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: start;
  }
}

/* The problems: a plain list with a mustard rule, not cards. */
.problem-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .problem-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-4);
  }
}

.problem-list li {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding-block-start: var(--space-3);
  border-block-start: 3px solid var(--color-secondary);
}

/* Ticks in front of the editing features. */
.check-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-inline-start: 2rem;
}

.check-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0.25rem;
  inset-block-start: 0.35em;
  inline-size: 0.55rem;
  block-size: 0.95rem;
  border: solid var(--color-primary);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-5) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.gallery a {
  display: block;
  border-radius: var(--radius);
  cursor: zoom-in;
}

.gallery img {
  inline-size: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* The phone shot: the top of the page in the same box, so the grid stays even. */
.gallery__portrait img {
  object-position: top center;
  background: var(--color-text);
}

.gallery figcaption {
  color: var(--color-text-muted);
}

.gallery figcaption strong {
  color: var(--color-text);
}

/* ---------- Compliance ---------- */

.compliance {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

@media (min-width: 48rem) {
  .compliance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compliance div {
  padding: var(--card-padding);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-page);
}

.compliance dt {
  font-family: var(--font-heading);
  font-size: var(--font-size-h3);
  font-weight: 600;
  line-height: var(--line-height-heading);
  color: var(--color-heading);
}

.compliance dd {
  margin: var(--space-2) 0 0;
}

/* ---------- Offer and contact ---------- */

.offer {
  display: grid;
  gap: var(--space-5);
  padding: var(--panel-padding);
  border-radius: var(--radius-large);
  background: var(--color-primary);
}

@media (min-width: 56rem) {
  .offer {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
  }
}

.offer__contact {
  display: grid;
  gap: var(--space-2);
}

.offer__mail {
  font-size: var(--font-size-lead);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* A visible placeholder for data the owner has to give (CLAUDE.md, „Tartalmi pontosság”). */
.placeholder {
  justify-self: start;
  padding: var(--space-1) var(--space-2);
  border-inline-start: 4px solid var(--color-highlight-border);
  background: var(--color-highlight);
  color: var(--color-text);
}

/* ---------- Image viewer (gallery.js; after ImageViewer, docs/DESIGN.md „Felugró ablak”) ---------- */

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-2);
  inline-size: 100vw;
  block-size: 100dvh;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: var(--space-3);
  border: 0;
  background: transparent;
  overscroll-behavior: contain;
}

.viewer::backdrop {
  background: rgb(23 36 29 / 0.92);
  overflow: hidden;
  overscroll-behavior: contain;
}

.viewer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.viewer__count {
  font-weight: 600;
}

.viewer__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.viewer__stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: var(--space-2);
  min-block-size: 0;
  margin: 0;
}

.viewer__stage img {
  inline-size: auto;
  block-size: auto;
  max-inline-size: min(95vw, 100%);
  max-block-size: 100%;
  object-fit: contain;
  background: var(--color-background);
}

.viewer__stage figcaption {
  max-inline-size: var(--measure);
  text-align: center;
}

@media (max-width: 39.99rem) {
  .viewer .button {
    flex: 1 1 auto;
    padding-inline: var(--space-3);
  }
}

/* ---------- Imprint ---------- */

.page {
  padding-block: var(--section-gap);
}

.page h1 {
  font-size: var(--font-size-h2);
}

.page h2 {
  font-size: var(--font-size-h3);
}

.page .stack > h2 {
  margin-block-start: var(--space-5);
}
