/* ============================================================
   GLYN'S GARDENING SERVICE — Modern Redesign
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-dark:   #0f5c2e;
    --green-mid:    #1a7a3e;
    --green-light:  #2ea84f;
    --green-pale:   #e8f5ec;
    --green-accent: #4cbb6c;
    --white:        #ffffff;
    --off-white:    #f8faf8;
    --grey-100:     #f2f4f2;
    --grey-200:     #e4e8e4;
    --grey-400:     #9aaa9a;
    --grey-700:     #3d4d3d;
    --text-dark:    #1a2a1a;
    --text-mid:     #3d4d3d;
    --text-light:   #6b7d6b;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;

    --radius-sm:  0.375rem;
    --radius-md:  0.75rem;
    --radius-lg:  1.25rem;
    --radius-xl:  2rem;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

    --transition: 0.25s ease;
    --max-width:  1200px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

/* --- Buttons ---------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition),
                transform var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid var(--green-accent);
    outline-offset: 3px;
}

.btn-primary {
    background: var(--green-mid);
    color: var(--white);
    border-color: var(--green-mid);
}

.btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.7);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--white);
}

.btn-hero {
    background: var(--white);
    color: var(--green-dark);
    border-color: var(--white);
}

.btn-hero:hover {
    background: var(--green-pale);
    border-color: var(--green-pale);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-lg {
    font-size: 1rem;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

/* --- Section Shared --------------------------------------- */
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 3.5rem;
}

.section-header--light .section-title,
.section-header--light .section-sub {
    color: var(--white);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section-sub {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* --- Navigation ------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 80px;
    display: flex;
    align-items: center;
}

.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-right: 2.5rem;
}

.nav-logo img {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    /* compensate for any transparent padding baked into the image */
    margin-top: auto;
    margin-bottom: auto;
}

#primaryNav {
    flex: 1;
    display: flex;
    align-items: center;
}

#primaryNav ul {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

#primaryNav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-mid);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

#primaryNav a:hover {
    color: var(--green-mid);
    background: var(--green-pale);
}

.nav-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--green-mid);
    transition: background var(--transition), color var(--transition);
}

.social-link:hover {
    background: var(--green-pale);
    color: var(--green-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Back to Top ------------------------------------------ */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: var(--green-mid);
    color: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition),
                background var(--transition), transform var(--transition);
}

#backToTop:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

/* --- Hero ------------------------------------------------- */
.hero {
    min-height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-light) 100%);
    display: flex;
    align-items: center;
    padding: 5rem 0;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('images/leaves-pattern.png');
    background-repeat: repeat;
    opacity: 0.06;
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-accent);
    background: rgba(255,255,255,0.1);
    padding: 0.35rem 0.9rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.15);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    object-fit: cover;
    aspect-ratio: 4/3;
}

/* --- Portfolio -------------------------------------------- */
.portfolio {
    padding: 6rem 0;
    background: var(--off-white);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 260px;
    gap: 1rem;
    grid-auto-flow: dense; /* backfills gaps automatically */
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--grey-200);
    cursor: pointer;
}

.portfolio-item--tall {
    grid-row: span 2;
}

.portfolio-item--wide {
    grid-column: span 2;
}

/* 2-column layout at mid widths */
@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }

    /* wide span would leave a gap in 2-col — disable it */
    .portfolio-item--wide {
        grid-column: span 1;
    }
}

/* single column on small mobile */
@media (max-width: 520px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }

    .portfolio-item--tall {
        grid-row: span 1;
    }
}

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

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

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,92,46,0.75) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay span {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.02em;
}

/* --- Services --------------------------------------------- */
.services {
    padding: 6rem 0;
    background: linear-gradient(160deg, var(--green-dark) 0%, var(--green-mid) 100%);
    position: relative;
    overflow: hidden;
}

.services::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('images/leaves-pattern.png');
    background-repeat: repeat;
    opacity: 0.05;
    pointer-events: none;
}

.services .section-inner {
    position: relative;
    z-index: 1;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-card__image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-card__image img {
    transform: scale(1.05);
}

.service-card__body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.service-card__body h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
    line-height: 1.3;
}

.service-card__body p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.65;
}

/* --- Contact ---------------------------------------------- */
.contact {
    padding: 6rem 0;
    background: var(--white);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 5rem;
    align-items: start;
}

.contact-info .section-title {
    margin-bottom: 1rem;
}

.contact-intro {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-details li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-mid);
}

.contact-details li svg {
    color: var(--green-mid);
    flex-shrink: 0;
}

.contact-details a {
    color: var(--green-mid);
    font-weight: 500;
    transition: color var(--transition);
}

.contact-details a:hover {
    color: var(--green-dark);
}

.contact-social {
    display: flex;
    gap: 0.5rem;
}

.contact-social .social-link {
    background: var(--green-pale);
    color: var(--green-mid);
}

.contact-social .social-link:hover {
    background: var(--green-mid);
    color: var(--white);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-mid);
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--grey-100);
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color var(--transition), background var(--transition),
                box-shadow var(--transition);
    outline: none;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--grey-400);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--green-mid);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26,122,62,0.12);
}

.form-group textarea {
    min-height: 140px;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
    background: var(--grey-700);
    padding: 1rem 0 1.5rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

.footer-logo img {
    height: 110px;
    width: auto;
    opacity: 0.9;
    display: block;
    transition: opacity var(--transition);
}

.footer-logo:hover img {
    opacity: 1;
}

.footer-copy {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    flex: 1;
    text-align: center;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
}

.footer-social .social-link {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.08);
}

.footer-social .social-link:hover {
    color: var(--white);
    background: var(--green-mid);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large tablet */
@media (max-width: 1100px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-inner {
        gap: 2.5rem;
    }
}

/* Tablet — stack vertically */
@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding: 4rem 0 3rem;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .hero-ctas {
        justify-content: center;
    }

    .hero-image img {
        max-width: 480px;
        margin: 0 auto;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-info {
        text-align: center;
    }

    .contact-details li {
        justify-content: center;
    }

    .contact-social {
        justify-content: center;
    }
}

/* Mobile nav */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-actions .btn {
        display: none;
    }

    #primaryNav {
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--grey-200);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        z-index: 99;
    }

    #primaryNav.open {
        max-height: 300px;
    }

    #primaryNav ul {
        flex-direction: column;
        padding: 0.75rem 0;
    }

    #primaryNav a {
        display: block;
        padding: 0.75rem 2rem;
        border-radius: 0;
        font-size: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Small mobile */
@media (max-width: 520px) {
    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .hero-ctas .btn {
        width: 100%;
        max-width: 280px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-copy {
        text-align: center;
    }
}

/* --- Service Area ----------------------------------------- */
.area {
    padding: 6rem 0;
    background: var(--off-white);
}

.area-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: stretch;
}

.area-map-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1.5px solid var(--grey-200);
    height: 420px;
}

#serviceMap {
    width: 100%;
    height: 420px;
}

/* Custom map marker */
.map-marker {
    width: 20px;
    height: 20px;
    background: var(--green-mid);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Override Leaflet popup to match brand */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    font-family: var(--font-body) !important;
    font-size: 0.875rem !important;
}

.leaflet-popup-content strong {
    color: var(--green-dark);
}

.area-cta {
    background: var(--white);
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.area-cta__icon {
    width: 64px;
    height: 64px;
    background: var(--green-pale);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-mid);
}

.area-cta h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-dark);
}

.area-cta p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

@media (max-width: 900px) {
    .area-layout {
        grid-template-columns: 1fr;
    }

    .area-map-wrap {
        height: 340px;
    }

    #serviceMap {
        height: 340px;
    }

    .area-cta {
        max-width: 360px;
        margin: 0 auto;
    }
}

@media (max-width: 520px) {
    .area-map-wrap {
        height: 280px;
    }

    #serviceMap {
        height: 280px;
    }
}
