/*
Theme Name: Borghi Fluviali
Theme URI: https://borghifluvialitraadigepo.com
Author: Arcadia Arte
Author URI: https://arcadia-arte.com
Description: Tema custom per Borghi Fluviali tra Adige e Po — senza dipendenze da page builder.
Version: 1.0.0
License: Proprietary
Text Domain: borghi-fluviali
*/

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-blue:       #2ea3f2;
    --color-teal:       #077470;
    --color-teal-dark:  #057471;
    --color-text:       #333333;
    --color-body:       #666666;
    --color-border:     #e2e2e2;
    --color-bg:         #ffffff;
    --color-accent:     #fbb03b;

    --font-main: 'Rubik', Helvetica, Arial, Lucida, sans-serif;
    --container-width: 80%;
    --container-max: 1080px;
    --header-height: 80px;
    --transition: 0.2s ease;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,.12);
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.25;
    font-weight: 700;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-teal);
}

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

ul, ol {
    list-style: none;
}

/* =============================================
   CONTAINER
   ============================================= */
.container {
    width: var(--container-width);
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 20px;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--color-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-teal);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-outline:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.btn-teal {
    background: var(--color-teal);
    color: #fff;
}

.btn-teal:hover {
    background: var(--color-teal-dark);
    color: #fff;
}

/* =============================================
   HEADER
   ============================================= */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    z-index: 9999;
    display: flex;
    align-items: center;
}

#site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Logo */
.site-logo img {
    height: 55px;
    width: auto;
}

/* Main nav */
#main-nav ul {
    display: flex;
    align-items: center;
    gap: 32px;
}

#main-nav ul li a {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition), color var(--transition);
}

#main-nav ul li a:hover,
#main-nav ul li.current-menu-item > a {
    color: var(--color-teal);
    border-bottom-color: var(--color-teal);
}

/* Sub-menus */
#main-nav ul li {
    position: relative;
}

#main-nav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--color-teal);
    padding: 8px 0;
    flex-direction: column;
    gap: 0;
}

#main-nav ul li:hover > ul {
    display: flex;
}

#main-nav ul li ul li a {
    display: block;
    padding: 8px 16px;
    font-size: 0.82rem;
    border-bottom: none;
    color: var(--color-text);
}

#main-nav ul li ul li a:hover {
    background: #f5f5f5;
    color: var(--color-teal);
}

/* Mobile hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition);
}

/* Push content below header */
.page-wrapper {
    margin-top: var(--header-height);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #057471 0%, #2ea3f2 100%);
}

.hero-section .hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-section .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5,116,113,.75) 0%, rgba(46,163,242,.6) 100%);
}

.hero-section .hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 700px;
    padding: 40px 20px;
}

.hero-section .hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    text-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.hero-section .hero-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255,255,255,.9);
    margin-bottom: 28px;
    line-height: 1.7;
}

.hero-logo {
    width: 180px;
    margin: 0 auto 24px;
    opacity: 0.95;
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
    padding: 72px 0;
}

.section-teal {
    background: var(--color-teal);
    color: #fff;
}

.section-teal h1,
.section-teal h2,
.section-teal h3 {
    color: #fff;
}

.section-teal p {
    color: rgba(255,255,255,.85);
}

.section-light {
    background: #f8f9fa;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-body);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.section-teal .section-subtitle {
    color: rgba(255,255,255,.8);
}

/* =============================================
   CARD GRID
   ============================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.card-text {
    font-size: 0.9rem;
    color: var(--color-body);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* =============================================
   BORGHI GRID (comuni)
   ============================================= */
.borghi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    text-align: center;
}

.borgo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.borgo-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    padding: 4px;
    background: #fff;
    transition: border-color var(--transition), transform var(--transition);
}

.borgo-item:hover img {
    border-color: var(--color-teal);
    transform: scale(1.08);
}

.borgo-item a {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
}

.borgo-item a:hover {
    color: var(--color-teal);
}

/* =============================================
   ITINERARI
   ============================================= */
.itinerari-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.itinerario-card {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    transition: background var(--transition);
}

.itinerario-card:hover {
    background: rgba(255,255,255,.18);
}

.itinerario-card h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
}

.itinerario-card p {
    font-size: 0.85rem;
    color: rgba(255,255,255,.8);
    margin-bottom: 12px;
}

/* =============================================
   EVENTI
   ============================================= */
.eventi-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.evento-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.evento-card .evento-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.evento-card .evento-body {
    padding: 20px;
}

.evento-card .evento-date {
    font-size: 0.8rem;
    color: var(--color-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.evento-card .evento-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.evento-card .evento-excerpt {
    font-size: 0.85rem;
    color: var(--color-body);
    margin-bottom: 16px;
}

/* =============================================
   PARTNERS
   ============================================= */
.partners-section {
    padding: 48px 0;
    border-top: 1px solid var(--color-border);
}

.partners-title {
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 28px;
    font-weight: 700;
}

.partners-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
}

.partners-logos img {
    height: 60px;
    width: auto;
    object-fit: contain;
    opacity: 0.75;
    transition: opacity var(--transition);
}

.partners-logos img:hover {
    opacity: 1;
}

/* =============================================
   FOOTER
   ============================================= */
#site-footer {
    background: var(--color-text);
    color: rgba(255,255,255,.7);
    padding: 40px 0 24px;
    font-size: 0.85rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col ul li a {
    color: rgba(255,255,255,.65);
    font-size: 0.83rem;
    transition: color var(--transition);
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-col p {
    color: rgba(255,255,255,.65);
    line-height: 1.7;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    color: rgba(255,255,255,.45);
    font-size: 0.8rem;
}

/* =============================================
   PAGE CONTENT
   ============================================= */
.page-hero {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #057471 0%, #2ea3f2 100%);
}

.page-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,116,113,.65);
}

.page-hero .page-hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
}

.page-hero h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #fff;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.page-hero p {
    margin-top: 12px;
    font-size: 1.05rem;
    color: rgba(255,255,255,.85);
}

.page-content {
    padding: 60px 0;
}

.prose {
    max-width: 760px;
    font-size: 1.02rem;
    line-height: 1.8;
    color: var(--color-body);
}

.prose h2 {
    font-size: 1.5rem;
    margin: 32px 0 12px;
}

.prose p {
    margin-bottom: 16px;
}

/* Single borgo/evento */
.single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.single-meta span {
    font-size: 0.82rem;
    color: var(--color-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.single-featured-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.82rem;
    color: #999;
}

.breadcrumb a {
    color: #999;
}

.breadcrumb a:hover {
    color: var(--color-teal);
}

.breadcrumb span {
    margin: 0 6px;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--color-border);
    color: var(--color-text);
    transition: all var(--transition);
}

.pagination a:hover,
.pagination .current {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 980px) {
    .card-grid-2,
    .card-grid-3 {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .borghi-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 64px;
    }

    #main-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        overflow-y: auto;
        z-index: 9998;
        padding: 24px;
    }

    #main-nav.is-open {
        display: block;
    }

    #main-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    #main-nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    #main-nav ul li a {
        display: block;
        padding: 14px 0;
        font-size: 1rem;
    }

    #main-nav ul li ul {
        display: none !important;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-section {
        min-height: 60vh;
    }

    .section {
        padding: 48px 0;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

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

    .page-hero {
        height: 280px;
    }

    .itinerari-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease both;
}

/* =============================================
   UTILITY
   ============================================= */
.text-center { text-align: center; }
.text-white  { color: #fff; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
    overflow: hidden;
}
