/*
Theme Name: JM Starter
Description: Clean starter theme for client websites. CSS-variable driven, block-based architecture. Ο.Σ.Α. (omsilaig.gr) fork.
Author: Jimmour
Version: 1.5.3-oms.2
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jm-starter
*/

/* ========================================
   BREAKPOINTS REFERENCE
   Mobile:  max-width: 768px
   Tablet:  min-width: 769px / max-width: 1024px
   Desktop: min-width: 1025px
   ======================================== */

/* ========================================
   TOKENS — Ο.Σ.Α. (the original site's palette, kept)
   ======================================== */
:root {
    /* Brand */
    --oms-cyan: #00d6d8;          /* header, bands, accents — the federation's colour */
    --oms-cyan-hover: #00c2c4;
    --oms-cyan-ink: #007274;      /* cyan as TEXT on white: #00d6d8 is only 1.9:1 there */
    --oms-pale: #edffff;          /* card grounds */
    --oms-pale-line: #c9f3f3;
    --oms-charcoal: #333333;      /* dark band */
    --oms-slate: #545454;         /* buttons, footer */
    --oms-ink: #23272b;           /* body text */
    --oms-ink-soft: #5b6268;
    --oms-white: #ffffff;
    --oms-shadow: 0 10px 30px rgba(17, 46, 51, 0.12), 0 2px 6px rgba(17, 46, 51, 0.06);
    --oms-shadow-sm: 0 4px 14px rgba(17, 46, 51, 0.10);
    --oms-radius: 16px;
    --oms-radius-sm: 10px;
    --oms-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --oms-header-h: 80px;

    /* Starter variables, mapped so inherited components follow the palette */
    --primary: var(--oms-cyan-ink);
    --primary-hover: #005a5c;
    --primary-light: var(--oms-pale);
    --header-bg: var(--oms-cyan);
    --header-text: #ffffff;
    --footer-bg: var(--oms-slate);
    --footer-text: #ffffff;
    --bg-main: #ffffff;
    --bg-white: #ffffff;
    --text-primary: var(--oms-ink);
    --text-secondary: var(--oms-ink-soft);
    --text-light: #8a9197;
    --border-light: #dde5e6;
    --error: #c62828;
    --success: #2e7d32;
    --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --container-max: 1200px;
    --section-padding: 80px 0;
    --ease: var(--oms-ease);
}

@media (max-width: 768px) {
    :root { --oms-header-h: 64px; --section-padding: 56px 0; }
}

/* ========================================
   GLOBAL
   ======================================== */
html { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--oms-header-h) + 16px);
       scrollbar-gutter: stable; /* locking scroll (menu, popups) must not shift the page sideways */ }

body {
    font-family: var(--font-primary);
    background: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; color: inherit; }

p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
@media (hover: hover) { a:hover { color: var(--primary-hover); } }

:focus-visible { outline: 3px solid var(--oms-cyan); outline-offset: 3px; }

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important;
    width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
    clip: auto !important; clip-path: none; height: auto; width: auto; z-index: 100000;
    background: #fff; color: var(--oms-ink); padding: 12px 18px; left: 8px; top: 8px; border-radius: 6px;
}

/* Native form controls get the site font (the starter's global button rules are gone on purpose:
   a bare `button:focus { transform: none }` wiped positioning transforms — see THEME.md gotcha #3). */
button, input, select, textarea { font: inherit; }

/* ========================================
   LAYOUT
   ======================================== */
.oms-container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.oms-container--narrow { max-width: 860px; }
@media (max-width: 768px) { .oms-container { padding: 0 16px; } }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 20px; } /* starter blocks */
.section { padding: var(--section-padding); }
.text-center { text-align: center; }

/* ========================================
   BUTTONS — the live site's slate buttons, made into real controls
   ======================================== */
.oms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 24px;
    border: 0;
    border-radius: 4px;
    background: var(--oms-slate);
    color: #fff;
    font-weight: 500;
    font-size: 15.5px;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, translate 0.15s ease;
}
.oms-btn:active { translate: 0 1px; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
@media (hover: hover) { .oms-btn:hover { background: #3d3d3d; color: #fff; } }

.oms-btn--light { background: #fff; color: var(--oms-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); }
@media (hover: hover) { .oms-btn--light:hover { background: var(--oms-pale); color: var(--oms-ink); } }

.oms-btn--cyan { background: var(--oms-cyan); color: #06393b; font-weight: 600; }
@media (hover: hover) { .oms-btn--cyan:hover { background: var(--oms-cyan-hover); color: #06393b; } }

.oms-btn--block { width: 100%; }

.oms-btn__icon { width: 18px; height: 18px; flex: none; }

/* The starter's form block: its submit used to inherit the global `button` rules removed above,
   so it is styled explicitly — the live site's full-width cyan "ΥΠΟΒΟΛΗ". */
.jm-form__submit {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 28px;
    border: 0;
    border-radius: 99px;
    background: var(--oms-cyan);
    color: #053b3d;
    font-size: 16.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0, 120, 122, 0.35);
    transition: background-color 0.2s ease, translate 0.15s ease, box-shadow 0.15s ease;
}
@media (hover: hover) { .jm-form__submit:hover { background: var(--oms-cyan-hover); } }
.jm-form__submit:active { translate: 0 2px; box-shadow: 0 1px 0 rgba(0, 120, 122, 0.35); }
.jm-form__foot { display: grid !important; gap: 10px !important; }
.jm-form__required { text-align: left; }

/* ========================================
   INNER-PAGE HERO + PANEL (live: photo band, title, chevron, card overlapping the band)
   ======================================== */
.oms-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(300px, 46vw, 520px);
    padding: calc(var(--oms-header-h) + 32px) 20px 150px;
    color: #fff;
    text-align: center;
    background: #24494b;
    overflow: hidden;
    isolation: isolate;
}
.oms-hero__img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: -2;
}
.oms-hero::after {   /* two-way scrim: enough for the title, keeps the photo bright */
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0) 65%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.05) 45%, rgba(0, 0, 0, 0.10) 100%);
}
.oms-hero__title {
    margin: 0;
    font-size: clamp(30px, 4.4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.oms-hero__chevron { display: block; width: 34px; height: 34px; margin: 18px auto 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }

.oms-panel {
    position: relative;
    margin: -120px auto 0;
    background: var(--oms-pale);
    border-radius: var(--oms-radius);
    box-shadow: var(--oms-shadow);
    padding: clamp(18px, 3vw, 36px);
}
.oms-panel + .oms-panel { margin-top: 28px; }
.oms-panel__title {
    text-align: center;
    color: var(--oms-cyan-ink);
    font-size: clamp(24px, 2.8vw, 32px);
    margin: 4px 0 24px;
}
.oms-page-end { height: clamp(48px, 7vw, 88px); }
@media (max-width: 768px) {
    .oms-hero { padding-bottom: 110px; }
    .oms-panel { margin-top: -84px; }
}

/* ========================================
   CARD GRID + POST CARD (live: image, cyan pill, title, excerpt, read more, date footer)
   ======================================== */
.oms-grid { display: grid; gap: clamp(16px, 2.2vw, 28px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1024px) { .oms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .oms-grid { grid-template-columns: minmax(0, 1fr); } }

.oms-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--oms-radius-sm);
    box-shadow: var(--oms-shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.25s ease, translate 0.25s var(--oms-ease);
}
@media (hover: hover) { .oms-card:hover { box-shadow: var(--oms-shadow); translate: 0 -3px; } }

.oms-card__media { position: relative; aspect-ratio: 16 / 10; background: #dfeff0; overflow: hidden; }
.oms-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: scale 0.5s var(--oms-ease); }
@media (hover: hover) { .oms-card:hover .oms-card__media img { scale: 1.04; } }

.oms-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    background: var(--oms-cyan);
    color: #053b3d;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.5;
}
.oms-card__media .oms-pill { position: absolute; top: 12px; right: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

.oms-card__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 18px; }
.oms-card__title { font-size: 19px; line-height: 1.32; margin: 0 0 10px; font-weight: 600; }
.oms-card__title a { color: var(--oms-ink); }
.oms-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
@media (hover: hover) { .oms-card:hover .oms-card__title a { color: var(--oms-cyan-ink); } }
.oms-card__excerpt { color: var(--oms-ink-soft); font-size: 15px; line-height: 1.6; margin: 0 0 14px; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.oms-card__more { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--oms-cyan-ink); }
.oms-card__foot {
    display: flex; gap: 8px; align-items: center;
    padding: 12px 22px; border-top: 1px solid #edf1f2;
    color: #7c858b; font-size: 13px;
}
.oms-card__foot svg { width: 14px; height: 14px; flex: none; }

/* ========================================
   PAGINATION + EMPTY STATE
   ======================================== */
.oms-pagination { margin-top: 32px; }
.oms-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.oms-pagination .page-numbers {
    display: inline-grid; place-items: center;
    min-width: 44px; height: 44px; padding: 0 14px;
    border-radius: 8px; background: #fff; color: var(--oms-ink);
    font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.oms-pagination .page-numbers.current { background: var(--oms-slate); color: #fff; }
.oms-pagination .page-numbers.dots { background: none; box-shadow: none; }
@media (hover: hover) { .oms-pagination a.page-numbers:hover { background: var(--oms-cyan); color: #053b3d; } }

.oms-empty {
    display: grid; justify-items: center; gap: 10px;
    padding: 36px 20px; text-align: center; color: var(--oms-ink-soft);
    background: rgba(255,255,255,.65); border: 1px dashed var(--oms-pale-line); border-radius: var(--oms-radius-sm);
}
.oms-empty svg { width: 34px; height: 34px; color: var(--oms-cyan-ink); opacity: .7; }
.oms-empty p { margin: 0; }

/* ========================================
   ROUND LINK ICONS (people, clubs, footer) — brand colour per network, as on the live site
   ======================================== */
.osa-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; }
.osa-links__a {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--osa-brand, var(--oms-slate)); color: #fff;
    transition: translate 0.2s var(--oms-ease), filter 0.2s ease;
}
.osa-links__a svg { width: 20px; height: 20px; }
@media (hover: hover) { .osa-links__a:hover { color: #fff; translate: 0 -2px; filter: brightness(1.12); } }
.osa-links--lg .osa-links__a { width: 48px; height: 48px; }
.osa-links--lg .osa-links__a svg { width: 23px; height: 23px; }

/* ========================================
   SECTION HEADINGS
   ======================================== */
.oms-section-title { text-align: center; font-size: clamp(26px, 3.2vw, 36px); margin: 0 0 8px; }
.oms-section-title--cyan { color: var(--oms-cyan-ink); }
.oms-section-sub { text-align: center; color: var(--oms-ink-soft); margin: 0 auto 28px; max-width: 60ch; }

/* ========================================
   MOTION — scroll reveal (js/reveal.js). Hidden state only once the script has run,
   so a JS failure can never leave the page blank.
   ======================================== */
html.jm-reveal-ready [data-reveal]:not(.is-revealed) { opacity: 0; transform: translateY(18px); }
[data-reveal] { transition: opacity 0.8s var(--oms-ease), transform 0.8s var(--oms-ease); }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { transition: none; }
    html.jm-reveal-ready [data-reveal]:not(.is-revealed) { opacity: 1; transform: none; }
    *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ========================================
      TOAST NOTIFICATIONS
   ======================================== */

.jm-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .jm-toast-container {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

.jm-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 3px solid;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.jm-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.jm-toast--exiting {
    opacity: 0;
    transform: translateY(16px);
}

/* Success */
.jm-toast--success {
    background-color: #f0fdf4;
    border-left-color: var(--success);
    color: #166534;
}
.jm-toast--success .jm-toast__icon { color: var(--success); }

/* Error */
.jm-toast--error {
    background-color: #fef2f2;
    border-left-color: var(--error);
    color: #991b1b;
}
.jm-toast--error .jm-toast__icon { color: var(--error); }

/* Info */
.jm-toast--info {
    background-color: #f3f4f6;
    border-left-color: #9ca3af;
    color: #374151;
}
.jm-toast--info .jm-toast__icon { color: #6b7280; }

/* Warning */
.jm-toast--warning {
    background-color: #fffbeb;
    border-left-color: #d97706;
    color: #92400e;
}
.jm-toast--warning .jm-toast__icon { color: #d97706; }

/* Toast inner elements */
.jm-toast__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.jm-toast__message {
    flex: 1;
    word-break: break-word;
}

.jm-toast__message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.jm-toast__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -4px -4px -4px 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.jm-toast__close:hover {
    opacity: 1;
    background: none;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .jm-toast { transition: none; }
}

/* ========================================

/* ========================================
   404 PAGE
   ======================================== */
.page-404 {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 70vh; text-align: center;
    padding: calc(var(--oms-header-h) + 60px) 20px 80px;
    background: linear-gradient(180deg, var(--oms-pale), #fff);
}
.page-404 h1 { font-size: clamp(88px, 16vw, 140px); font-weight: 700; color: var(--oms-cyan); margin: 0; line-height: 1; }
.page-404 h2 { font-size: clamp(22px, 3vw, 30px); margin: 10px 0 14px; color: var(--oms-ink); }
.page-404 p { font-size: 17px; color: var(--oms-ink-soft); margin-bottom: 28px; max-width: 520px; }
