/* =========================================================
   Educlima Search — v2
   Direzione: "schedario da campo" climatico-didattico
   Verde foglia + ambra solare + teal acqua, texture a curve
   di livello, tipografia Fraunces/Inter/IBM Plex Mono.
   Stesse classi dell'originale: drop-in replacement.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500&display=swap');

.educlima-wrapper {
    --edu-ink: #16241f;
    --edu-body: #3c4c44;
    --edu-bg: #eef2ec;
    --edu-panel: #f6f8f4;
    --edu-card: #ffffff;
    --edu-border: #d7e0d5;
    --edu-leaf: #2f6e4f;
    --edu-leaf-dark: #1f4d38;
    --edu-leaf-light: #e3efe6;
    --edu-amber: #c98a1f;
    --edu-amber-light: #faeed7;
    --edu-teal: #146b72;
    --edu-teal-light: #e1eff0;
    --edu-sage: #5c6d63;
    --edu-shadow: 0 16px 34px -18px rgba(31, 77, 56, .45);

    --edu-font-display: 'Fraunces', Georgia, serif;
    --edu-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --edu-font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

@media (prefers-reduced-motion: reduce) {
    .educlima-wrapper * {
        transition: none !important;
        animation: none !important;
    }
}

/* Layout Generale Educlima Search */
.educlima-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
    font-family: var(--edu-font-body);
    color: var(--edu-body);
    align-items: start;
}

@media (max-width: 768px) {
    .educlima-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Form Filtri */
.educlima-form {
    position: relative;
    background: var(--edu-panel);
    padding: 1.75rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--edu-border);
    overflow: hidden;
    top: 0;
}

@media (min-width: 769px) {
    .educlima-form {
        position: sticky;
        top: 1.5rem;
    }
}

/* texture a curve di livello, ancorata in alto a destra */
.educlima-form::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-radial-gradient(
        circle at 100% 0%,
        rgba(47, 110, 79, .07) 0px,
        rgba(47, 110, 79, .07) 1px,
        transparent 1px,
        transparent 15px
    );
    pointer-events: none;
}

.educlima-form-header {
    position: relative;
    margin-bottom: 0.5rem;
}

.educlima-form-header::before {
    content: "FILTRI DI RICERCA";
    display: block;
    font-family: var(--edu-font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--edu-amber);
    margin-bottom: 0.4rem;
}

.educlima-form-header h2 {
    position: relative;
    margin-top: 0;
    margin-bottom: 0;
    font-family: var(--edu-font-display);
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--edu-ink);
    letter-spacing: -0.01em;
}

.educlima-form-header h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 10px;
    margin-top: 0.55rem;
    background-color: var(--edu-amber);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 10'><path d='M1 6 Q6 1 11 6 T21 6 T31 6 T41 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 10'><path d='M1 6 Q6 1 11 6 T21 6 T31 6 T41 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.educlima-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.educlima-field h3,
.educlima-field label strong {
    display: block;
    font-family: var(--edu-font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--edu-sage);
    margin-bottom: 0.6rem;
}

.educlima-field input[type="text"],
.educlima-field select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--edu-border);
    border-radius: 8px;
    background: var(--edu-card);
    font-family: var(--edu-font-body);
    font-size: 0.92rem;
    color: var(--edu-ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.educlima-field input[type="text"]:focus-visible,
.educlima-field select:focus-visible {
    outline: none;
    border-color: var(--edu-leaf);
    box-shadow: 0 0 0 3px var(--edu-leaf-light);
}

.educlima-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease;
}

.educlima-checkbox:hover {
    background: var(--edu-leaf-light);
}

.educlima-checkbox input {
    margin-right: 0.6rem;
    width: 16px;
    height: 16px;
    accent-color: var(--edu-leaf);
    cursor: pointer;
}

.educlima-checkbox input:focus-visible {
    outline: 2px solid var(--edu-leaf);
    outline-offset: 2px;
}

.educlima-actions {
    display: flex;
    gap: 1.1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.educlima-submit {
    background-color: var(--edu-leaf);
    color: #fff;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    font-family: var(--edu-font-body);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.educlima-submit:hover {
    background-color: var(--edu-leaf-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(31, 77, 56, .55);
}

.educlima-submit:focus-visible {
    outline: 2px solid var(--edu-leaf-dark);
    outline-offset: 3px;
}

.educlima-reset {
    color: var(--edu-sage);
    text-decoration: none;
    border-bottom: 1px dashed var(--edu-sage);
    font-size: 0.88rem;
    transition: color .15s ease, border-color .15s ease;
}

.educlima-reset:hover {
    color: var(--edu-ink);
    border-color: var(--edu-ink);
}

/* Griglia Risultati */
.educlima-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .educlima-results-grid {
        grid-template-columns: 1fr;
    }
}

.educlima-card {
    position: relative;
    background: var(--edu-card);
    border: 1px solid var(--edu-border);
    border-radius: 14px;
    padding: 1.4rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, border-color .2s ease;
}

.educlima-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--edu-leaf), var(--edu-teal));
}

.educlima-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--edu-shadow);
    border-color: var(--edu-leaf);
}

.educlima-card-title {
    position: relative;
    margin-top: 0.3rem;
    padding-bottom: 0.5rem;
    font-family: var(--edu-font-display);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.educlima-card-title::after {
    content: "";
    display: block;
    width: 36px;
    height: 9px;
    margin-top: 0.5rem;
    background-color: var(--edu-leaf);
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 10'><path d='M1 6 Q6 1 11 6 T21 6 T31 6 T41 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 10'><path d='M1 6 Q6 1 11 6 T21 6 T31 6 T41 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.educlima-card-title a {
    text-decoration: none;
    color: var(--edu-ink);
    transition: color .15s ease;
}

.educlima-card-title a:hover {
    color: var(--edu-leaf-dark);
}

.educlima-card-subtitle {
    color: var(--edu-sage);
    font-family: var(--edu-font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    margin-top: 0;
    margin-bottom: 0.25rem;
}

.educlima-card-meta {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.educlima-badge {
    background: var(--edu-leaf-light);
    color: var(--edu-leaf-dark);
    border: 1px dotted transparent;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-family: var(--edu-font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.educlima-card-meta .educlima-badge:nth-of-type(2) {
    background: var(--edu-teal-light);
    color: var(--edu-teal);
}

.educlima-card-meta .educlima-badge:nth-of-type(3) {
    background: var(--edu-amber-light);
    color: var(--edu-amber);
}

.educlima-badge-light {
    background: var(--edu-bg);
    color: var(--edu-sage);
    border: 1px dotted var(--edu-border);
}

.educlima-card-actions {
    margin-top: auto;
    padding-top: 0.9rem;
    display: flex;
    gap: 0.6rem;
}

.educlima-card-link {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    background: var(--edu-leaf);
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 500;
    transition: background-color .15s ease, transform .15s ease;
}

.educlima-card-link:hover {
    background: var(--edu-leaf-dark);
    transform: translateY(-1px);
}

.educlima-card-link:focus-visible {
    outline: 2px solid var(--edu-leaf-dark);
    outline-offset: 2px;
}

.educlima-card-link.secondary {
    background: transparent;
    color: var(--edu-sage);
    border: 1px solid var(--edu-border);
}

.educlima-card-link.secondary:hover {
    background: var(--edu-bg);
    color: var(--edu-ink);
    border-color: var(--edu-sage);
}
