/* ══════════════════════════════════════════════════════════════
   FIORITURA.IT — Stylesheet
   Fonts: Libre Baskerville (display) + Source Sans 3 (body)
   ══════════════════════════════════════════════════════════════ */

:root {
    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, sans-serif;
    --bg: #FFFCF7;
    --text: #2B1E10;
    --muted: #8C7B6A;
    --accent: #B5654A;
    --border: #EDE4D8;
    --card: #FFFFFF;
    --dark: #2B1E10;
}

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

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--dark); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,252,247,0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { font-size: 26px; }
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.logo-tld { font-size: 9px; color: var(--accent); background: #FFF0E8; padding: 3px 7px; border-radius: 4px; font-weight: 700; letter-spacing: 1.5px; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
    color: var(--muted); transition: all 0.15s;
}
.main-nav a:hover, .main-nav a.active { background: var(--dark); color: #fff; }

.header-search input {
    padding: 7px 14px; border: 2px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: var(--font-body); width: 180px;
    background: #fff; outline: none; transition: border-color 0.2s;
}
.header-search input:focus { border-color: var(--accent); }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    padding: 72px 24px 56px; text-align: center;
    background: linear-gradient(180deg, #FEF6ED 0%, var(--bg) 100%);
}
.hero-label { font-size: 11px; letter-spacing: 4px; color: var(--accent); font-weight: 700; margin-bottom: 14px; display: block; }
.hero h1 { font-family: var(--font-display); font-size: clamp(32px,5vw,52px); font-weight: 700; line-height: 1.15; margin-bottom: 18px; }
.hero h1 em { color: var(--accent); font-weight: 400; }
.hero p { font-size: 16px; line-height: 1.7; color: var(--muted); max-width: 520px; margin: 0 auto 28px; }

.btn { display: inline-block; padding: 14px 36px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; font-family: var(--font-body); }
.btn-primary { background: var(--dark); color: #fff; }
.btn-primary:hover { background: #1a1008; color: #fff; }
.btn-outline { background: transparent; color: var(--dark); border: 2px solid var(--dark); padding: 12px 28px; }

/* ── Sections ────────────────────────────────────────────── */
.section { padding: 40px 0 48px; }
.section h2 { font-family: var(--font-display); font-size: 26px; margin-bottom: 6px; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.page-header { padding: 36px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.page-header h1 { font-family: var(--font-display); font-size: 30px; margin-bottom: 6px; }
.page-header p { color: var(--muted); font-size: 14px; }

/* ── Category Grid ───────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cat-card {
    padding: 16px; background: var(--card); border-radius: 12px; border: 1px solid var(--border);
    text-align: center; transition: all 0.2s; display: block; color: var(--text);
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); color: var(--text); }
.cat-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.cat-name { font-size: 13px; font-weight: 600; display: block; }
.cat-count { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }

/* ── Flower Cards ────────────────────────────────────────── */
.flower-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.flower-card {
    background: var(--card); border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border); transition: all 0.3s; display: block; color: var(--text);
}
.flower-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); color: var(--text); }
.flower-card-hero { height: 160px; display: flex; align-items: center; justify-content: center; position: relative; }
.flower-card-emoji { font-size: 56px; }
.flower-card-diff { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.9); padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.flower-card-body { padding: 16px; }
.flower-card-body h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 2px; }
.flower-card-latin { font-size: 12px; color: var(--muted); font-style: italic; }
.flower-card-body p { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 8px; }
.flower-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.flower-card-tags span { padding: 3px 8px; background: #f8f3ee; border-radius: 4px; font-size: 11px; color: var(--muted); }

/* ── Encyclopedia ────────────────────────────────────────── */
.enc-search-wrap { position: relative; max-width: 500px; margin-bottom: 16px; }
.enc-search { margin-bottom: 0; max-width: none; }
.enc-search input {
    width: 100%; padding: 11px 16px; border-radius: 10px; border: 2px solid var(--border);
    font-size: 14px; font-family: var(--font-body); background: #fff; outline: none;
}
.enc-search input:focus { border-color: var(--accent); }
.enc-filters { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn {
    background: #f5f0ea; color: var(--muted); padding: 6px 14px; border-radius: 6px;
    font-size: 12px; font-weight: 600; transition: all 0.15s;
}
.filter-btn.active, .filter-btn:hover { background: var(--dark); color: #fff; }
.enc-alphabet { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 20px; }
.alpha-btn {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 4px; font-size: 11px; font-weight: 600;
    color: var(--text); transition: all 0.15s;
}
.alpha-btn.active, .alpha-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.enc-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.enc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 32px; }
.enc-card {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--card); border-radius: 10px; border: 1px solid var(--border);
    transition: all 0.2s; color: var(--text);
}
.enc-card:hover { border-color: var(--accent); transform: translateX(3px); color: var(--text); }
.enc-card-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.enc-card-info { flex: 1; min-width: 0; }
.enc-card-name { font-size: 14px; font-weight: 600; }
.enc-card-latin { font-size: 11px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-card-diff { font-size: 10px; font-weight: 600; flex-shrink: 0; }
.enc-empty { text-align: center; padding: 48px; color: var(--muted); }

/* ── Fiore Detail ────────────────────────────────────────── */
.fiore-hero { padding: 48px 24px 36px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--dark); }
.fiore-hero-emoji { font-size: 48px; margin-bottom: 12px; }
.fiore-hero h1 { font-family: var(--font-display); font-size: clamp(28px,4vw,40px); margin-bottom: 6px; }
.fiore-hero-latin { font-size: 15px; color: var(--muted); font-style: italic; margin-bottom: 16px; }
.fiore-hero-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tag { background: rgba(255,255,255,0.75); padding: 6px 14px; border-radius: 6px; font-size: 12px; }

.fiore-layout { display: grid; grid-template-columns: 1fr 300px; gap: 36px; padding-top: 36px; padding-bottom: 48px; }

/* Article body */
.article-body { text-align: justify; }
.article-body h2 {
    font-family: var(--font-display); font-size: 26px; margin-top: 36px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.article-body h3 { font-family: var(--font-display); font-size: 20px; margin-top: 28px; margin-bottom: 10px; }
.article-body h4 { font-family: var(--font-display); font-size: 17px; margin-top: 20px; margin-bottom: 8px; }
.article-body p { font-size: 15px; line-height: 1.85; margin-bottom: 12px; color: #3D3020; }
.article-body strong { color: var(--text); font-weight: 600; }

/* Sidebar */
.fiore-sidebar { position: sticky; top: 76px; align-self: start; }
.sidebar-box { background: var(--card); border-radius: 14px; border: 1px solid var(--border); padding: 20px; margin-bottom: 20px; }
.sidebar-box h3 { font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }
.sidebar-disclaimer { font-size: 11px; color: var(--muted); margin-bottom: 14px; }

/* ── Amazon Product Cards (native ad style) ─────────────── */
.amazon-product-card {
    display: flex; gap: 12px; padding: 14px;
    background: #fff; border-radius: 12px; border: 1px solid var(--border);
    margin-bottom: 10px; transition: all 0.2s; color: var(--text);
    text-decoration: none;
}
.amazon-product-card:hover {
    border-color: #FF9900;
    box-shadow: 0 4px 14px rgba(255,153,0,0.15);
    transform: translateY(-1px);
    color: var(--text);
}
.amazon-product-img {
    flex-shrink: 0;
    width: 90px; height: 90px;
    border-radius: 8px; overflow: hidden;
    background: #f8f3ee;
    display: flex; align-items: center; justify-content: center;
}
.amazon-product-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.amazon-product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.amazon-product-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.amazon-product-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.amazon-product-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.price { font-size: 15px; font-weight: 700; color: #B12704; }
.amazon-btn {
    font-size: 11px; color: #111;
    background: #FFD814;
    padding: 4px 10px; border-radius: 20px;
    font-weight: 600; white-space: nowrap;
    border: 1px solid #FCD200;
}
.sidebar-disclaimer {
    font-size: 10px; color: var(--muted); font-style: italic;
    margin-bottom: 12px; line-height: 1.4;
}

/* ── Amazon Inline Banner (in-article) ──────────────────── */
.amazon-inline-banner {
    margin: 28px 0;
    padding: 16px;
    background: linear-gradient(135deg, #FFF8E7 0%, #FFFAF3 100%);
    border: 1px solid #FFE4B3;
    border-radius: 14px;
    position: relative;
}
.aib-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent); margin-bottom: 10px;
}
.aib-link {
    display: flex; gap: 16px; align-items: center;
    text-decoration: none; color: var(--text);
}
.aib-link:hover { color: var(--text); }
.aib-link:hover .aib-btn { background: #FDA41F; }
.aib-img {
    flex-shrink: 0;
    width: 100px; height: 100px;
    border-radius: 10px; overflow: hidden;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #FFE4B3;
}
.aib-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* Emoji styling for product cards when no CDN image */
.amazon-product-emoji, .aib-emoji {
    display: flex; align-items: center; justify-content: center;
    font-size: 3.2em;
    line-height: 1;
}
.amazon-product-emoji-inline {
    font-size: 3.2em; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
/* Pre-rendered fallback spans: nascosti di default, rivelati da onerror dell'img */
.aib-img-fallback, .amazon-product-img-fallback {
    display: none;
    font-size: 3.2em;
    line-height: 1;
    width: 100%; height: 100%;
    align-items: center; justify-content: center;
}
.aib-content { flex: 1; min-width: 0; }
.aib-nome { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.aib-desc { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.aib-footer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.aib-prezzo { font-size: 18px; font-weight: 700; color: #B12704; }
.aib-btn {
    display: inline-block;
    background: #FFD814; color: #111;
    padding: 8px 20px; border-radius: 24px;
    font-size: 13px; font-weight: 600;
    border: 1px solid #FCD200;
    transition: background 0.2s;
}
.aib-disclaimer {
    font-size: 10px; color: var(--muted);
    text-align: right; margin-top: 10px;
    font-style: italic;
}
@media (max-width: 640px) {
    .aib-link { flex-direction: column; align-items: stretch; }
    .aib-img { width: 100%; height: 160px; }
    .amazon-product-card { flex-direction: column; }
    .amazon-product-img { width: 100%; height: 140px; }
}

/* Related flowers */
.related-flower { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; margin-bottom: 4px; transition: all 0.15s; color: var(--text); }
.related-flower:hover { background: #f8f3ee; color: var(--text); }
.related-emoji { font-size: 20px; }
.related-name { font-size: 12px; font-weight: 600; }
.related-latin { font-size: 10px; color: var(--muted); }

/* ── Stats Bar ───────────────────────────────────────────── */
.stats-bar { background: var(--dark); padding: 48px 24px; color: #fff; }
.stats-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 12px; color: #a89880; margin-top: 3px; display: block; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--dark); padding: 40px 24px 20px; color: #a89880; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; margin-bottom: 32px; }
.footer-col h4 { font-weight: 600; color: #e8d5c0; font-size: 11px; margin-bottom: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.footer-col a { display: block; font-size: 12px; margin-bottom: 5px; color: #a89880; }
.footer-col a:hover { color: #e8d5c0; }
.footer-logo { font-size: 18px; font-weight: 700; color: #fff; font-family: var(--font-display); margin-bottom: 10px; }
.footer-col p { font-size: 12px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid #3d3225; padding-top: 16px; text-align: center; font-size: 11px; }

/* ── Ad Placeholder ──────────────────────────────────────── */
.ad-placeholder { text-align: center; padding: 20px; background: #f8f3ee; border: 1px dashed #d4c9bc; border-radius: 8px; margin: 24px 0; color: #8a7968; font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
    .header-search { order: 3; width: 100%; margin-top: 8px; }
    .header-search input { width: 100%; }
    .main-nav { flex-wrap: wrap; }
    .fiore-layout { grid-template-columns: 1fr; }
    .fiore-sidebar { position: static; }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 28px; }
    .enc-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTI AGGIUNTIVI
   ══════════════════════════════════════════════════════════════ */

/* ── Cookie Banner ───────────────────────────────────────── */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: rgba(43,30,16,0.98); backdrop-filter: blur(10px);
    padding: 20px 24px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-inner { max-width: 960px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.cookie-text { flex: 1; min-width: 300px; }
.cookie-text p { color: #d4c9bc; font-size: 13px; line-height: 1.5; margin: 0 0 6px; }
.cookie-text p:first-child { font-size: 14px; margin-bottom: 8px; }
.cookie-text strong { color: #fff; }
.cookie-links { margin-top: 4px !important; }
.cookie-links a { color: var(--accent); font-size: 12px; }
.cookie-buttons { display: flex; gap: 8px; flex-shrink: 0; flex-direction: column; align-items: stretch; }
.btn-sm { padding: 10px 22px !important; font-size: 13px !important; white-space: nowrap; }

/* ── Hamburger Menu ──────────────────────────────────────── */
.desktop-only { display: flex; }
.mobile-only { display: none; }
.hamburger {
    background: none; border: none; cursor: pointer; padding: 8px;
    display: flex; flex-direction: column; gap: 5px; width: 32px;
}
.hamburger span {
    display: block; height: 2px; background: var(--dark); border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
    display: none; background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 16px 24px;
}
.mobile-menu.open { display: block; }
.mobile-search { margin-bottom: 12px; }
.mobile-search input {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: var(--font-body);
}
.mobile-nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
    padding: 10px 12px; border-radius: 8px; font-size: 15px;
    font-weight: 600; color: var(--text); transition: background 0.15s;
}
.mobile-nav a:hover { background: #f5f0ea; }

/* ── Back to Top ─────────────────────────────────────────── */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px; z-index: 100;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--dark); color: #fff; border: none;
    font-size: 20px; cursor: pointer; display: none;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s;
}
.back-to-top:hover { background: var(--accent); transform: translateY(-2px); }

/* ── Table of Contents ───────────────────────────────────── */
.toc {
    background: #faf6f1; border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 24px; margin-bottom: 28px;
}
.toc-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 4px; }
.toc li a {
    font-size: 13.5px; color: var(--muted); display: block;
    padding: 4px 0; border-bottom: 1px solid transparent;
    transition: all 0.15s;
}
.toc li a:hover { color: var(--accent); }
.toc li.toc-sub { padding-left: 16px; }
.toc li.toc-sub a { font-size: 12.5px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; font-weight: 600; color: var(--muted);
    transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.page-dots { display: inline-flex; align-items: center; padding: 0 4px; color: var(--muted); }

/* ── Social Share ────────────────────────────────────────── */
.social-share {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 0; margin-top: 24px;
    border-top: 1px solid var(--border);
}
.share-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.share-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; transition: transform 0.15s;
}
.share-btn:hover { transform: scale(1.1); }
.share-fb { background: #1877f2; }
.share-tw { background: #000; }
.share-wa { background: #25d366; }
.share-pin { background: #e60023; }

/* ── Legal Pages ─────────────────────────────────────────── */
.legal-page { max-width: 800px; padding: 36px 24px 48px; }
.legal-page h1 { font-family: var(--font-display); font-size: 30px; margin-bottom: 8px; }
.legal-update { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ── Responsive Updates ──────────────────────────────────── */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
    .cookie-inner { flex-direction: column; text-align: center; gap: 16px; }
    .cookie-text { min-width: auto; }
    .cookie-buttons { flex-direction: row; justify-content: center; }
    .toc { padding: 16px; }
    .social-share { flex-wrap: wrap; justify-content: center; }
    .back-to-top { bottom: 80px; }
}

/* ── Reading Progress Bar ────────────────────────────────── */
.reading-progress {
    position: fixed; top: 0; left: 0; z-index: 9999;
    height: 3px; width: 0; background: var(--accent);
    transition: width 0.1s linear;
}

/* ── Contact Form ────────────────────────────────────────── */
.contact-form { margin-top: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-group input, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: var(--font-body);
    background: #fff; outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 120px; }

/* ── Messages ────────────────────────────────────────────── */
.msg-success { padding: 14px 18px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; color: #166534; margin-bottom: 16px; font-size: 14px; }
.msg-error { padding: 14px 18px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #991b1b; margin-bottom: 16px; font-size: 14px; }

/* ── Smooth scroll ───────────────────────────────────────── */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ── Flower Images ──────────────────────────────────────── */

/* Hero con foto */
.fiore-hero.has-photo {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: flex-end;
    padding: 0;
    overflow: hidden;
}
.fiore-hero-img {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.fiore-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.fiore-hero.has-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(43,30,16,0.85) 0%, rgba(43,30,16,0.4) 50%, rgba(43,30,16,0.15) 100%);
    z-index: 1;
}
.fiore-hero.has-photo .fiore-hero-content {
    position: relative;
    z-index: 2;
    padding: 36px 24px;
    width: 100%;
}
.fiore-hero.has-photo h1,
.fiore-hero.has-photo .fiore-hero-latin,
.fiore-hero.has-photo .breadcrumbs,
.fiore-hero.has-photo .breadcrumbs a {
    color: #fff;
}
.fiore-hero.has-photo .breadcrumbs a:hover { color: #fde6c8; }
.fiore-hero.has-photo .tag {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}
.fiore-hero-credit {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    margin-top: 12px;
}

/* Card con foto (home featured) */
.flower-card-hero.has-photo {
    padding: 0;
    overflow: hidden;
}
.flower-card-hero.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.flower-card:hover .flower-card-hero.has-photo img {
    transform: scale(1.05);
}

/* Enc-card con thumbnail */
.enc-card.has-thumb {
    padding: 0;
    overflow: hidden;
}
.enc-card-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    overflow: hidden;
}
.enc-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.enc-card.has-thumb .enc-card-info {
    padding: 10px 12px 10px 0;
}
.enc-card.has-thumb .enc-card-diff {
    padding-right: 12px;
}

@media (max-width: 768px) {
    .fiore-hero.has-photo { min-height: 300px; }
    .enc-card-thumb { width: 56px; height: 56px; }
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   NEW FEATURES CSS
   ═══════════════════════════════════════════════════════════ */

/* ── AJAX Search Dropdown ──────────────────────────────── */
.header-search-wrap { position: relative; }
.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.sr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    border-bottom: 1px solid #f5f0ea;
    transition: background 0.15s;
}
.sr-item:hover { background: #faf6f1; color: var(--text); }
.sr-item:last-child { border-bottom: none; }
.sr-emoji { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.sr-text { flex: 1; min-width: 0; }
.sr-text strong { font-size: 14px; display: block; }
.sr-text small { font-size: 11px; color: var(--muted); font-style: italic; }

/* ── Fiore del Giorno ──────────────────────────────────── */
.fiore-giorno {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.fiore-giorno-visual {
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.fiore-giorno-visual img { width: 100%; height: 100%; object-fit: cover; }
.fiore-giorno-info { padding: 24px 24px 24px 0; }
.fiore-giorno-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
}
.fiore-giorno-info h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 4px; }
.fiore-giorno-info h2 a { color: var(--text); }
.fiore-giorno-info h2 a:hover { color: var(--accent); }
.fiore-giorno-latin { font-style: italic; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.fiore-giorno-info p { font-size: 14px; line-height: 1.6; color: var(--muted); margin-bottom: 14px; }

/* ── Situazioni Grid ───────────────────────────────────── */
.sit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}
.sit-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
    color: var(--text);
}
.sit-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); color: var(--text); }
.sit-icon { font-size: 28px; }
.sit-name { font-size: 12px; font-weight: 600; line-height: 1.3; }

/* ── Confronta Tabella ─────────────────────────────────── */
.confronta-selector { margin-bottom: 32px; }
.confronta-form { display: flex; flex-direction: column; gap: 16px; }
.confronta-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.confronta-slot label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.confronta-slot input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
}
.confronta-slot input[type="text"]:focus { border-color: var(--accent); outline: none; }
.confronta-slot { position: relative; }
.confronta-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: -2px; }

.confronta-table-wrap { overflow-x: auto; margin-top: 24px; }
.confronta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.confronta-table th {
    padding: 20px 16px;
    background: #faf6f1;
    border-bottom: 2px solid var(--border);
    text-align: center;
    vertical-align: top;
}
.confronta-nome { color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.confronta-nome:hover { color: var(--accent); }
.confronta-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f0ea;
    text-align: center;
    vertical-align: top;
}
.confronta-label {
    text-align: left !important;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    background: #faf6f1;
    min-width: 130px;
}
.tag-diff { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tag-facile { background: #f0fdf4; color: #166534; }
.tag-media { background: #fffbeb; color: #92400e; }
.tag-difficile { background: #fef2f2; color: #991b1b; }

/* ── Filtri Avanzati Enciclopedia ──────────────────────── */
.adv-filters {
    margin: 12px 0 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf6f1;
}
.adv-filters-toggle {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
}
.adv-filters-toggle::-webkit-details-marker { display: none; }
.adv-filters-toggle::before { content: '▸ '; }
.adv-filters[open] .adv-filters-toggle::before { content: '▾ '; }
.adv-filters-form { padding: 0 16px 14px; }
.adv-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: end;
}
.adv-filters-grid label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.adv-filters-grid select {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-body);
    background: #fff;
}

/* ── Responsive nuovi componenti ───────────────────────── */
@media (max-width: 768px) {
    .fiore-giorno { grid-template-columns: 1fr; }
    .fiore-giorno-visual { min-height: 160px; }
    .fiore-giorno-info { padding: 20px; }
    .sit-grid { grid-template-columns: repeat(2, 1fr); }
    .confronta-inputs { grid-template-columns: 1fr; }
    .confronta-table { font-size: 12px; }
    .confronta-label { min-width: 90px; font-size: 11px; }
    .confronta-table th, .confronta-table td { padding: 8px 10px; }
    .adv-filters-grid { grid-template-columns: 1fr 1fr; }
    .header-search-wrap { display: none; }
}

