/* 
    La Casa dei Girasoli - Custom Styles
    Theme: Sunflowers, warm, welcoming, simple, soft rounded borders.
*/

:root {
    --primary-color: #fca311; /* Sunflower Yellow / Orange */
    --primary-hover: #e08e0b;
    --accent-color: #8c5a2b; /* Earthy Brown for contrast */
    --light-bg: #fffbf5; /* Very soft warm white */
    --sunflower-bg: #fef0d8;
    --text-main: #212529; /* Dark gray for high contrast */
    --text-muted: #596167; /* Darker gray for WCAG 2 AA compliance (4.5:1 on white and light background) */
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--light-bg);
}

/* Fix per ancore con sticky navbar */
section[id] {
    scroll-margin-top: 85px; /* Offset per compensare l'altezza della navbar */
}

/* Utilities */
.text-accent {
    color: var(--accent-color) !important;
}

.bg-sunflower {
    background-color: var(--primary-color) !important;
}

.bg-sunflower-light {
    background-color: var(--sunflower-bg) !important;
}

.soft-rounded {
    border-radius: 20px !important;
}

.max-w-700 {
    max-width: 700px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #212529; /* Dark text for WCAG 2 AA contrast ratio of 7.74:1 on yellow background */
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #212529;
}

/* Navbar */
.navbar {
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url('img/giardino1.webp') center/cover no-repeat;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    margin-bottom: 2rem;
}

.hero-content {
    animation: fadeIn 1.5s ease-in-out;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); /* Text shadow to guarantee readability */
}

/* Cards & Images */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.room-img {
    height: 250px;
    object-fit: cover;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Controls */
.form-control {
    border: 1px solid #e0e0e0;
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(252, 163, 17, 0.25);
}

.filter-white {
    filter: brightness(0) invert(1);
}

/* Lighter placeholder text */
::placeholder {
    color: #adb5bd !important;
    opacity: 1; /* Firefox */
}

::-ms-input-placeholder {
    color: #adb5bd !important;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    padding: 14px 16px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Gallery Section Category Title */
.gallery-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin: 2rem 0 1rem;
}

/* =====================
   SPACE CARDS — Modern Room Layout
   ===================== */

.space-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.3s ease;
}

.space-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Hero image of the space card (clickable, opens lightbox) */
.space-hero-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* Wrapper link that holds hero image — needs relative for zoom icon */
.space-card a[data-gallery] {
    position: relative;
    display: block;
    overflow: hidden;
}

.space-card a[data-gallery]:hover .space-hero-img {
    transform: scale(1.04);
}

/* Zoom icon overlay on hero image hover */
.space-hero-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background: rgba(252, 163, 17, 0.85);
    color: #212529;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.space-card a[data-gallery]:hover .space-hero-zoom {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Badge label (e.g. "Camera Matrimoniale") */
.space-badge {
    display: inline-block;
    background-color: var(--sunflower-bg);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 50px;
}

/* Room name */
.space-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

/* Thumbnail strip below description */
.thumb-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thumb-strip a {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.thumb-strip a:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.thumb-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* On mobile: stack image on top, full width */
@media (max-width: 767px) {
    .space-hero-img {
        height: 220px;
    }
    .space-card .p-4 {
        padding: 1.25rem !important;
    }
    .thumb-strip a {
        width: 60px;
        height: 60px;
    }
}

/* Footer Link Overrides for WCAG 2 AA Compliance */
footer a, footer a.iubenda-white {
    color: #d1d5db !important;
    transition: color 0.2s ease;
}

footer a:hover, footer a.iubenda-white:hover {
    color: var(--primary-color) !important;
}

/* Force GLightbox Close Button Visibility */
.gclose {
    opacity: 1 !important;
    z-index: 999999 !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-radius: 50% !important;
}
.gclose svg {
    fill: #ffffff !important;
}
