/*
 * style.css
 * Βασικό στυλ του site tassosdimou.gr.
 * Οργάνωση: 1) reset, 2) CSS variables (design tokens), 3) βασική τυπογραφία,
 *           4) layout/components, 5) utilities.
 * Mobile-first: οι κανόνες εδώ ισχύουν από τα μικρότερα πλάτη· οι προσαρμογές
 * για μεγαλύτερες οθόνες βρίσκονται στο responsive.css.
 */

/* ============ 1. Ελάχιστο reset ============ */

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

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

body {
  margin: 0;
}

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

/* ============ 2. Design tokens ============ */

:root {
  /* -- Χρώματα (§Δ) -- */
  --color-bg: #f4f0e6;
  --color-ink: #1e2124;
  --color-ink-muted: #5b6167;
  --color-rule: #d8d4cb;
  --color-accent: #1f5c56;
  --color-accent-emphasis: #2f7a70;
  --color-focus: #2f7a70;

  /* -- Τυπογραφία (§Ε) -- */
  --font-serif: "Literata", "Noto Serif", Georgia, serif;
  --font-sans: "Inter", "Segoe UI", Arial, sans-serif;

  --fs-body: 1.0625rem; /* ~17px */
  --fs-small: 0.9375rem;
  --fs-h1: clamp(2rem, 1.5rem + 2vw, 3rem);
  --fs-h2: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-h3: 1.25rem;
  --fs-lede: 1.25rem;

  --lh-body: 1.65;
  --lh-heading: 1.25;

  /* -- Διαστήματα (8px βάση) -- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  /* Κατακόρυφο διάστημα ενοτήτων (πάνω και κάτω από κάθε ενότητα) */
  --section-gap: 1.25rem;

  /* -- Πλάτη διάταξης -- */
  --width-text: 42rem; /* στήλη ανάγνωσης */
  --width-page: 72rem; /* μέγιστο πλάτος περιεχομένου */
  --gutter: 1.25rem;

  /* -- Περιγράμματα / σκιές (ελάχιστες, §15) -- */
  --radius: 4px;
  --rule: 1px solid var(--color-rule);
}

/* ============ 3. Βασική τυπογραφία ============ */

body {
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "onum" 1, "kern" 1;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
}

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

h3 {
  font-size: var(--fs-h3);
}

p {
  margin: 0 0 var(--space-3);
  max-width: var(--width-text);
}

.lede {
  font-size: var(--fs-lede);
  color: var(--color-ink-muted);
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-accent-emphasis);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* Skip-link για πληκτρολόγιο/screen readers (§18) */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  background: var(--color-ink);
  color: var(--color-bg);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  transition: top 0.15s ease;
  z-index: 10;
}

.skip-link:focus {
  top: var(--space-2);
}

/* Κείμενο μόνο για screen readers (π.χ. για να ξεχωρίζουν σύνδεσμοι με ίδιο ορατό κείμενο) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ετικέτες UI (μενού, μεταδεδομένα, tags) σε Inter, όχι σε Literata */
nav,
.meta,
.tag,
footer {
  font-family: var(--font-sans);
}

.meta,
.tag {
  font-size: var(--fs-small);
  color: var(--color-ink-muted);
}

/* ============ 4. Layout / components ============ */

.page {
  max-width: var(--width-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* -- Header / πλοήγηση -- */

.site-header {
  border-bottom: var(--rule);
  padding-block: var(--space-3);
}

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

.site-header__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--color-ink);
}

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

.site-nav a {
  color: var(--color-ink);
  text-decoration: none;
  font-size: var(--fs-small);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* -- Hero -- */

.hero {
  padding-block: var(--space-4) var(--section-gap);
  border-bottom: var(--rule);
}

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

.hero__diagram {
  color: var(--color-ink-muted);
  max-width: 20rem;
}

.hero__diagram svg,
.hero__diagram img {
  width: 100%;
  height: auto;
}

/* -- Ενότητες -- */

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

.section:last-of-type {
  border-bottom: none;
}

.section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 0.75rem;
}

.section__heading h2 {
  margin-bottom: 0;
}

.section__link {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  white-space: nowrap;
}

/* -- Κάρτες (εκπαιδευτικό υλικό, άρθρα) -- */

.card-grid {
  display: grid;
  gap: var(--space-3);
}

.card {
  border: var(--rule);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.card h3 {
  margin-bottom: var(--space-1);
}

.card p {
  margin-bottom: 0;
  font-size: var(--fs-small);
  color: var(--color-ink-muted);
}

/* -- Βιβλίο (hero teaser) -- */

.book-teaser {
  display: grid;
  gap: var(--space-3);
  align-items: start;
}

.book-teaser__cover {
  border: var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 14rem;
}

.book-teaser__cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* -- Footer -- */

.site-footer {
  padding-block: var(--space-4);
  color: var(--color-ink-muted);
  font-size: var(--fs-small);
}

.site-footer a {
  color: inherit;
}
