@import url("variables.css");

/* ---------- Alap ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-base);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-text);
    background: var(--color-bg);
}

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

a {
    color: var(--color-primary-dark);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

h1, h2, h3, h4 {
    font-family: var(--font-base);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 var(--space-sm);
    color: var(--color-primary-dark);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-sm); }

.section {
    padding: var(--space-xl) 0;
}
.section--alt {
    background: var(--color-surface-alt);
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border: none;
    border-radius: var(--radius);
    font-size: var(--fs-body);
    font-weight: 700;
    cursor: pointer;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn--accent { background: var(--color-accent); }
.btn--accent:hover { background: var(--color-accent-dark); }
.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border: var(--border-width) solid var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary); color: var(--color-primary-contrast); }
.btn--danger { background: var(--color-danger); }

/* ---------- Fejléc / navigáció ---------- */
.site-header {
    background: var(--color-surface);
    border-bottom: var(--border-width) solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}
.site-logo img { height: 48px; width: auto; }

.nav-toggle {
    display: none;
    background: none;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.4rem 0.6rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-primary-dark);
}

.main-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-nav__list a {
    color: var(--color-text);
    font-weight: 700;
    padding: 0.4rem 0.1rem;
    border-bottom: 2px solid transparent;
}
.main-nav__list a:hover,
.main-nav__list a.is-active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

.lang-switch a {
    border: var(--border-width) solid var(--color-border);
    border-radius: 999px;
    padding: 0.3rem 0.9rem !important;
    font-size: var(--fs-small);
}
.lang-switch a:hover {
    background: var(--color-surface-alt);
    border-color: var(--color-accent);
}

.has-dropdown { position: relative; }
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    min-width: 160px;
    padding: 0.4rem 0;
    box-shadow: 0 8px 20px rgba(36, 31, 24, 0.12);
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
    display: block;
}
.dropdown a {
    display: block;
    padding: 0.55rem 1rem;
    border-bottom: none;
    font-weight: 400;
    color: var(--color-text);
}
.dropdown a:hover { background: var(--color-surface-alt); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-primary-dark);
    color: #EDE8D9;
    margin-top: var(--space-xl);
}
.site-footer .container {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}
.site-footer h4 { color: #FFFFFF; margin-bottom: 0.5rem; }
.site-footer a { color: #EDE8D9; }

/* Felső sor: kennel neve + a szerzői jogi sor, középre igazítva */
.site-footer .footer-top {
    text-align: center;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.site-footer .footer-top__name {
    color: #FFFFFF;
    font-size: 1.25rem;
    margin-right: 0.75rem;
}
.site-footer .footer-top__copy { font-size: var(--fs-small); }

/* Alsó sor: balra az Oldalak, jobbra az Elérhetőségek */
.site-footer .footer-cols {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: space-between;
}
.site-footer .footer-col { min-width: 220px; }
.site-footer .footer-col--contact { text-align: right; }
.site-footer .footer-col p { margin: 0; }
@media (max-width: 560px) {
    .site-footer .footer-col--contact { text-align: left; }
}

/* ---------- Főoldal (hero / bemutatkozás) ---------- */
.hero {
    padding: var(--space-xl) 0;
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-lg);
    align-items: center;
}
.hero__images {
    display: grid;
    gap: var(--space-sm);
}
.hero__images img {
    width: 100%;
    /* A kép az eredeti arányát megtartja (nincs kivágás, nincs torzítás).
       Ha inkább egységes, fix magasságú képeket szeretnél a Főoldalon,
       írd át pl. "height: 280px;"-re - az object-fit: cover ilyenkor
       arányosan vágja a képet a megadott magasságra. */
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
    border: var(--border-width) solid var(--color-border);
}
.hero__text .lead {
    font-size: 1.15rem;
    color: var(--color-text-muted);
}
/* Ha még nincs feltöltve Főoldal-kép, a szöveg töltse ki a teljes
   konténer szélességét - így nem marad üres, "kilógó" hasáb jobb oldalt. */
.hero__grid--text-only {
    grid-template-columns: 1fr;
}
.hero__grid--text-only .hero__text {
    max-width: 68ch; /* olvasható sorhossz, ne fusson szét túl szélesen */
    margin: 0 auto;  /* a szövegblokk maga is középre kerüljön a konténeren belül */
    text-align: center;
}

/* ---------- Galéria ---------- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
}
.album-card {
    display: block;
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    color: inherit;
}
.album-card:hover { text-decoration: none; border-color: var(--color-accent); }
.album-card__image {
    aspect-ratio: 4 / 3;
    background: var(--color-surface-alt);
    overflow: hidden;
}
.album-card__image img { width: 100%; height: 100%; object-fit: cover; }
.album-card__body { padding: var(--space-sm); }
.album-card__body h3 { margin: 0 0 0.2rem; }
.album-card__count { color: var(--color-text-muted); font-size: var(--fs-small); }

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}
.image-grid__item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    border: var(--border-width) solid var(--color-border);
    background: var(--color-surface-alt);
    cursor: zoom-in;
}
.image-grid__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.image-grid__item:hover img { transform: scale(1.04); }

.back-link { display: inline-block; margin-bottom: var(--space-md); }

/* Lightbox (vanilla JS által vezérelve) */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 17, 12, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-md);
}
.lightbox.is-open { display: flex; }
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
}
.lightbox__close,
.lightbox__prev,
.lightbox__next {
    position: absolute;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--color-text);
}
.lightbox__close { top: var(--space-md); right: var(--space-md); }
.lightbox__prev { left: var(--space-md); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--space-md); top: 50%; transform: translateY(-50%); }

/* ---------- Almok (alomkártyák) ----------
   Minden alom egy önálló, keretezett "kártya": felül az alom neve +
   Születési idő / Alomszám, alatta teljes szélességben Apa / Anya.
   CSS Grid "grid-template-areas"-t használunk, mert így a mobil-nézet
   (lásd lentebb a media query-t) mindössze az elrendezés átdefiniálásával
   megoldható, a HTML-t egyáltalán nem kell duplikálni vagy módosítani. */
.litter-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.litter-card {
    border: 2px solid var(--color-primary-dark);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-border);
}
.litter-card__top,
.litter-card__bottom {
    display: grid;
    gap: 1px; /* a háttérszín (color-border) "átüt" ezen a résen - ez adja a vékony rácsvonalakat */
}
.litter-card__top > div,
.litter-card__bottom > div {
    background: var(--color-surface);
    padding: 0.65rem 0.9rem;
}
.litter-card__top {
    grid-template-columns: 1fr 1.3fr 1.3fr;
    grid-template-areas:
        "name    birthlabel  countlabel"
        "name    birthvalue  countvalue";
}
.litter-card__bottom {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "fatherlabel  motherlabel"
        "fathervalue  mothervalue";
}
.litter-card__name {
    grid-area: name;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary-dark);
    background: var(--color-surface-alt) !important;
}
.litter-card__label {
    font-weight: 700;
    text-align: center;
    color: var(--color-primary-contrast);
    background: var(--color-primary) !important;
}
.litter-card__label--birth   { grid-area: birthlabel; }
.litter-card__label--count   { grid-area: countlabel; }
.litter-card__label--father  { grid-area: fatherlabel; }
.litter-card__label--mother  { grid-area: motherlabel; }
.litter-card__value {
    text-align: center;
}
.litter-card__value--birth   { grid-area: birthvalue; }
.litter-card__value--count   { grid-area: countvalue; }
.litter-card__value--father  { grid-area: fathervalue; }
.litter-card__value--mother  { grid-area: mothervalue; }
.litter-count { font-weight: 700; color: var(--color-accent-dark); }

/* Mobilon a kártya teljesen egy oszlopba, egymás alá rendeződik -
   így minden adat cím-érték párként, jól olvashatóan jelenik meg,
   nincs vízszintes görgetés vagy összepréselődő szöveg. */
@media (max-width: 560px) {
    .litter-card__top {
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "birthlabel"
            "birthvalue"
            "countlabel"
            "countvalue";
    }
    .litter-card__bottom {
        grid-template-columns: 1fr;
        grid-template-areas:
            "fatherlabel"
            "fathervalue"
            "motherlabel"
            "mothervalue";
    }
}

/* ---------- Kutyáink ---------- */
.dogs-list {
    display: flex;
    flex-direction: column;
}
.dog-entry {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: var(--space-lg);
    align-items: start;
    padding: var(--space-lg) 0;
    border-top: var(--border-width) solid var(--color-border);
}
.dog-entry:first-child { border-top: none; padding-top: var(--space-sm); }
.dog-entry__name {
    font-size: var(--fs-h2);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-sm);
}
.dog-entry__facts {
    margin: 0 0 var(--space-sm);
    padding: 0;
    line-height: 1.5;
}
.dog-entry__facts div { display: flex; }
.dog-entry__facts dt { font-weight: 700; margin: 0 0.4rem 0 0; }
.dog-entry__facts dd { margin: 0; }
.dog-entry__section-title {
    font-size: 1.05rem;
    color: var(--color-primary-dark);
    margin: var(--space-md) 0 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid var(--color-border);
}
.dog-entry__results { list-style: none; margin: 0; padding: 0; }
.dog-entry__results li {
    padding: 0.6rem 0;
    border-bottom: var(--border-width) dashed var(--color-border);
}
.dog-entry__results li:last-child { border-bottom: none; }
.dog-entry__result-meta {
    display: block;
    font-size: var(--fs-small);
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.dog-entry__result-titles {
    margin: 0;
    padding-left: 1.2rem;
}
.dog-entry__result-titles li {
    font-weight: 700;
    padding: 0.1rem 0;
    border-bottom: none;
}
.dog-entry__photo img {
    width: 100%;
    border-radius: var(--radius);
    border: var(--border-width) solid var(--color-border);
}
.dogs-empty { color: var(--color-text-muted); padding: var(--space-md) 0; }

.subnav {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}
.subnav a {
    padding: 0.5rem 1.1rem;
    border: var(--border-width) solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text);
    font-weight: 700;
}
.subnav a.is-active,
.subnav a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-primary-contrast);
    text-decoration: none;
}

/* ---------- Hírek ---------- */
.news-list { display: flex; flex-direction: column; }
.news-item {
    padding: var(--space-lg) 0;
    border-top: var(--border-width) solid var(--color-border);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-md);
}
.news-item:first-child { border-top: none; padding-top: var(--space-sm); }
.news-item__image { border-radius: var(--radius); overflow: hidden; border: var(--border-width) solid var(--color-border); aspect-ratio: 4/3; }
.news-item__image img { width: 100%; height: 100%; object-fit: cover; }
.news-item__date { color: var(--color-text-muted); font-size: var(--fs-small); margin-bottom: 0.3rem; }
.news-single__date { color: var(--color-text-muted); margin-bottom: var(--space-md); }
.news-single__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}
.news-single__figure {
    margin: 0;
}
.news-single__figure img { border-radius: var(--radius); border: var(--border-width) solid var(--color-border); }
.news-single__figure figcaption {
    margin-top: 0.35rem;
    font-size: var(--fs-small);
    color: var(--color-text-muted);
    text-align: center;
}

/* ---------- Kapcsolat ---------- */
.contact-card {
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    max-width: 480px;
}
.contact-card dt { font-weight: 700; color: var(--color-text-muted); font-size: var(--fs-small); margin-top: var(--space-sm); }
.contact-card dt:first-child { margin-top: 0; }
.contact-card dd { margin: 0.15rem 0 0; font-size: 1.1rem; }

/* ---------- Reszponzív ---------- */
@media (max-width: 860px) {
    .hero__grid { grid-template-columns: 1fr; }
    .dog-entry { grid-template-columns: 1fr; }
    .dog-entry__photo { order: -1; max-width: 320px; }
    .news-item { grid-template-columns: 1fr; }
    .news-item__image { max-width: 320px; }
}

@media (max-width: 700px) {
    .nav-toggle { display: inline-block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.is-open { display: block; }
    .site-header__inner { flex-wrap: wrap; }
    .main-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: var(--space-sm) 0;
        width: 100%;
    }
    .main-nav__list > li { width: 100%; }
    .main-nav__list a { display: block; padding: 0.7rem 0; }
    .has-dropdown .dropdown {
        display: none;
        position: static;
        border: none;
        box-shadow: none;
        padding-left: var(--space-sm);
    }
    .has-dropdown.is-open .dropdown { display: block; }
    .subnav { flex-wrap: wrap; }
}

/* Kutyáink: "Adatlap" gomb + réteg (modal) az eredményeknek és orvosi szűréseknek */
.dog-entry__sheet-btn { margin-top: var(--space-sm); }
.dog-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: rgba(20, 17, 12, 0.85);   /* ugyanaz a sötét háttér, mint a Galéria lightboxánál */
}
.dog-modal[hidden] { display: none; }
.dog-modal__panel {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;                      /* a tartalom a rétegen belül görgethető */
    overscroll-behavior: contain;          /* a görgetés ne "szökjön át" a háttér oldalra */
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: var(--space-lg);
}
.dog-modal__close {
    position: sticky;                      /* görgetés közben is látható marad */
    top: 0;
    float: right;
    width: 44px;
    height: 44px;
    margin: 0 0 0.5rem 0.5rem;
    border: none;
    border-radius: 50%;
    background: var(--color-bg, #f4f1ea);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text);
}
.dog-modal__close:hover { background: var(--color-border); }
body.has-modal { overflow: hidden; }       /* nyitott rétegnél a háttér oldal nem görgethető */
