/* ==========================================================================
   Horváth Kertépítő Kft. – stíluslap
   Színvilág és díszítőelemek a cég szórólapja alapján.
   Mobile-first felépítés: alapstílusok mobilra, majd @media bővítések.
   ========================================================================== */

:root {
    --color-bg: #F2F0EA;
    --color-primary: #3E4426;
    --color-secondary: #8A8B52;
    --color-accent: #A9A868;
    --color-dark-section: #2E3320;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --header-height: 72px;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-primary);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

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

section {
    padding: 60px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Egyszerű gomb stílusok */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: .3px;
    border: none;
    cursor: pointer;
    transition: background .25s ease, transform .2s ease;
}

.btn-primary {
    background: var(--color-secondary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

/* ==========================================================================
   Levél-motívum díszítés (a szórólap vonalas leveleit idézi, halványan)
   ========================================================================== */

.hero, .services, .site-footer {
    position: relative;
    overflow: hidden;
}

.hero::before, .services::after, .site-footer::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23A9A868' stroke-width='1'%3E%3Cpath d='M50 90 C20 70 10 40 50 10 C90 40 80 70 50 90 Z'/%3E%3Cpath d='M50 90 V15'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: .12;
    pointer-events: none;
}

.hero::before {
    top: -40px;
    right: -40px;
}

.services::after {
    bottom: -40px;
    left: -40px;
    transform: scaleX(-1);
}

.site-footer::before {
    bottom: -30px;
    right: -30px;
    opacity: .08;
}

/* ==========================================================================
   Fejléc / navigáció
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    height: var(--header-height);
    transition: box-shadow .25s ease;
}

.site-header.scrolled {
    box-shadow: 0 2px 12px rgba(62, 68, 38, .15);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-primary);
}

.logo-text em {
    font-style: normal;
    color: var(--color-secondary);
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.hamburger span {
    display: block;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    box-shadow: 0 4px 12px rgba(62, 68, 38, .1);
}

.main-nav.open {
    max-height: 300px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    padding: 10px 20px 20px;
}

.main-nav a {
    display: block;
    padding: 12px 0;
    font-weight: 500;
    color: var(--color-primary);
    border-bottom: 2px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--color-secondary);
    border-color: var(--color-accent);
}

/* ==========================================================================
   Hero szekció
   ========================================================================== */

.hero {
    padding: 0;
    max-width: none;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(46, 51, 32, .6), rgba(46, 51, 32, .6)), url("../images/hero.jpg");
    background-size: cover;
    background-position: center;
}

/* JS állítja be, ha a hero.jpg nem tölthető be – tiszta gradiens fallback */
.hero.no-image {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.hero-content {
    padding: 40px 24px;
    max-width: 700px;
}

.hero h1 {
    color: #fff;
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.hero-slogan {
    color: var(--color-bg);
    font-size: 1.1rem;
    margin-bottom: 28px;
}

/* ==========================================================================
   Szolgáltatások szekció
   ========================================================================== */

.services h2,
.gallery h2,
.contact h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.service-card {
    background: #fff;
    border: 1px solid rgba(169, 168, 104, .3);
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    transition: transform .25s ease, border-color .25s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
}

.service-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.service-card p {
    font-size: .92rem;
    color: #555;
}

/* ==========================================================================
   Galéria / Referenciák szekció
   ========================================================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #e5e3da;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

/* Ha a kép hibás/hiányzik, elrejtjük és megjelenítjük a szomszédos placeholdert */
.gallery-item img.img-error {
    display: none;
}

.gallery-placeholder {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--color-secondary);
    background: #e5e3da;
}

.gallery-item img.img-error + .gallery-placeholder {
    display: flex;
}

.gallery-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: .5;
}

.gallery-placeholder span {
    font-size: .85rem;
    font-weight: 500;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(46, 51, 32, .92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 6px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
}

.lightbox-close {
    top: 16px;
    right: 16px;
}

.lightbox-prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
}

.lightbox-next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
}

/* ==========================================================================
   Kapcsolat szekció
   ========================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.contact-info p {
    margin-bottom: 20px;
}

.contact-info ul {
    list-style: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.contact-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    color: var(--color-secondary);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: .9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    background: #fff;
    color: var(--color-primary);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 1px;
}

.form-group.input-error input,
.form-group.input-error textarea {
    border-color: #b3392f;
}

/* Honeypot mező: emberi látogatók elől elrejtve, botok elől nem "display:none"-nal */
.honeypot-wrap {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-feedback {
    font-size: .92rem;
    min-height: 1.2em;
}

.form-feedback.success {
    color: var(--color-primary);
    font-weight: 600;
}

.form-feedback.error {
    color: #b3392f;
    font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--color-dark-section);
    color: var(--color-bg);
    text-align: center;
    padding: 40px 20px;
}

.footer-company {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.site-footer a {
    color: var(--color-accent);
}

.footer-copy {
    margin-top: 16px;
    font-size: .8rem;
    opacity: .7;
}

#back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--color-secondary);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, background .25s ease;
    z-index: 90;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover {
    background: var(--color-accent);
}

/* ==========================================================================
   Fade-in scroll animáció
   ========================================================================== */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Breakpointok: tablet (600px) és desktop (900px)
   ========================================================================== */

@media (min-width: 600px) {
    .hamburger {
        display: none;
    }

    .main-nav {
        position: static;
        max-height: none;
        overflow: visible;
        box-shadow: none;
        background: none;
    }

    .main-nav ul {
        flex-direction: row;
        gap: 28px;
        padding: 0;
    }

    .main-nav a {
        padding: 8px 0;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 2.6rem;
    }
}

@media (min-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero h1 {
        font-size: 3.2rem;
    }
}
