/* ==========================================================================
   Components CSS - Stili componenti riutilizzabili
   IlBoscoDegliAngeli.Blazor
   ========================================================================== */

/* ==========================================================================
   Skip Link (Accessibilità)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 9999;
}

.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   Header Components
   ========================================================================== */

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color var(--transition-base);
}

.header-contact-item:hover {
    color: var(--color-accent);
}

.header-contact-item .icon {
    flex-shrink: 0;
}

.header-hours {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.header-hours .icon {
    flex-shrink: 0;
}

/* ==========================================================================
   Footer Components
   ========================================================================== */

.footer-mission {
    margin-top: 1rem;
    font-style: italic;
    color: var(--color-accent);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.footer-section .icon {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.footer-social-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-legal .separator {
    color: rgba(255, 255, 255, 0.5);
}

.footer-credits {
    text-align: center;
    font-size: 0.875rem;
    margin: 0;
}

.footer-credits .heart {
    color: var(--color-accent);
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==========================================================================
   Card Components Base
   ========================================================================== */

.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.card-description {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.card-cta {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
}

.card-cta:hover {
    color: var(--color-primary-dark);
    transform: translateX(4px);
}

.card-cta::after {
    content: " →";
    transition: transform var(--transition-fast);
}

.card-cta:hover::after {
    transform: translateX(4px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

/* Hero wrapper */
.hero {
    position: relative;
    overflow: hidden;
}

/* Full-height variant used by pages that want a fullscreen hero */
.hero-fullheight {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* Background layer (image) */
.hero-background {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    z-index: 0;
    /* Ensure background does not intercept pointer events and cannot overlay other page chrome */
    pointer-events: none;
    /* Slightly darken the image to improve text contrast */
    filter: brightness(0.65) contrast(1);
}

/* Overlay sits above the background and below textual content */
.hero-overlay {
    position: absolute;
    inset: 0;
    /* reduced dark overlay to avoid covering the logo */
    background: linear-gradient(135deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0.14) 100%);
    z-index: 1;
    mix-blend-mode: normal;
}

/* Content sits above overlay */
.hero-content {
    position: relative;
    z-index: 2;
    /* Ensure text is readable above background */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure hero text and buttons render above overlay and are visible */
.hero .hero-title,
.hero .hero-subtitle,
.hero .hero-lead {
    color: white !important;
}

.hero .btn {
    position: relative;
    z-index: 3;
}

/* CTA Primary styles */
.cta-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
}

/* Ensure CTA primary sits above hero if any overlap occurs */
.cta-primary {
    position: relative;
    /* Force CTA above any hero stacking contexts */
    z-index: 11000 !important;
    transform: translateZ(0);
}

/* Small safety: ensure CTA has its own stacking context so z-index applies reliably */
.cta-primary { will-change: transform; }

.cta-primary-title {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 0.5rem;
}

.cta-primary-subtitle {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.75rem;
}

.cta-primary-availability {
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cta-primary-actions .btn {
    margin-right: 0.5rem;
}

/* Force hero block to sit below fixed/sticky chrome (header) */
.hero {
    z-index: 0;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Hero logo styling - small, centered, preserves existing layout */
.hero-logo-wrapper {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    width: clamp(56px, 8vw, 100px); /* smaller logo per user's preference */
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18));
    transform: translateY(0.25rem);
}

/* Ensure hero content spacing so overlay doesn't cut the logo visually */
.hero-content { 
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
}

.hero-lead {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Image Optimized
   ========================================================================== */

.image-wrapper {
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg-dark);
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.image-wrapper:hover img {
    transform: scale(1.05);
}

.image-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-light);
}

.image-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */

.breadcrumb {
    padding: 1rem 0;
    background: var(--color-bg-light);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: var(--color-text-light);
}

.breadcrumb-link {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--color-text);
}

/* ==========================================================================
   Service Card Specific
   ========================================================================== */

.service-card {
    text-align: center;
}

.service-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.service-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

/* ==========================================================================
   Blog Card Specific
   ========================================================================== */

.blog-card-image {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   City Card Specific
   ========================================================================== */

.city-card-location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.city-card-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.city-card-tag {
    padding: 0.25rem 0.75rem;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: var(--color-text);
}

/* ==========================================================================
   Responsive Cards Grid
   ========================================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
