:root {
    --color-primary: #2d5a3d;
    --color-secondary: #c4a574;
    --color-accent: #e8d4b8;
    --color-text: #2c2c2c;
    --color-light: #f5f1eb;
    --color-border: #d4c4b0;
    --font-serif: 'Georgia', serif;
    --font-sans: 'Segoe UI', Tahoma, Geneva, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1f4528 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-bottom: 4px solid var(--color-secondary);
}

header h1 {
    font-family: var(--font-serif);
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header .subtitle {
    font-size: 1.3em;
    font-style: italic;
    opacity: 0.95;
}

/* Small decorative image used around the main title */
.liana {
    height: 1.15em;          /* slightly larger than the text */
    width: auto;
    vertical-align: middle;  /* align with the text baseline */
    margin: 0 0.35em;
    display: inline-block;
}

nav {
    background-color: var(--color-primary);
    /* user requested: set padding-top to 3px (and bottom kept symmetric at 3px) */
    padding: 15px 0 1px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

/* Hamburger toggle button (hidden on wide screens) */
.nav-toggle {
    display: none; /* shown on small screens via media query */
    background: transparent;
    border: none;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
}
.nav-toggle .hamburger {
    display: inline-block;
    width: 22px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: currentColor;
}
.nav-toggle .hamburger::before { top: -7px; }
.nav-toggle .hamburger::after { top: 7px; }

nav a {
    display: block;
    color: white;
    /* user requested: vertical padding 2px (keeps horizontal padding for touch/click area) */
    padding: 2px 14px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Prevent sticky nav from covering anchored section headings
   When clicking an internal link the browser scrolls the element to the top of the viewport;
   `scroll-margin-top` provides an offset so the heading is visible below the sticky nav. */
.section {
    /* offset for sticky nav (updated after nav padding change) */
    scroll-margin-top: 72px; /* slightly increased per request */
}

/* Gallery styles for Il Viaggio section */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on wide screens */
    gap: 14px; /* space between thumbnails */
    margin-top: 18px;
}

/* Variant: 3-column gallery (used for Il Viaggio) */
.gallery-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Centered small gallery (use flex to center few items) */
.gallery.center {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.gallery a {
    display: block;
}
.gallery a img {
    width: 100%;
    height: 160px; /* fixed thumbnail height */
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    object-fit: cover;
}

@media (max-width: 1100px) {
    .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
    .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* On narrow screens the nav stacks and becomes taller; increase the offset accordingly */
@media (max-width: 768px) {
    /* on narrow screens nav stacks and becomes taller; keep a comfortable offset */
    .section { scroll-margin-top: 125px; }
}

/* Additional small-screen tweaks requested by user */
@media (max-width: 480px) {
    /* center title on very small screens */
    header h1 { text-align: center; }
    /* hide decorative liana images around the title */
    .liana { display: none !important; }
}

/* Mobile: collapse nav into hamburger */
@media (max-width: 768px) {
    .nav-toggle { display: inline-block; }
    /* add a bit more bottom padding to the sticky nav so the hamburger doesn't touch the bottom */
    nav { padding-bottom: 8px; }
    /* hide the horizontal nav and show vertical when open */
    nav ul#main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--color-primary);
        margin: 0;
        padding: 8px 0;
    }
    nav.open ul#main-nav {
        display: flex;
    }
    /* increase tap targets when menu is open */
    nav.open ul#main-nav a {
        padding: 12px 16px;
        display: block;
    }
}

@media (max-width: 420px) {
    .gallery { grid-template-columns: 1fr; }
}

/* Lightbox (modal) styles */
.lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}
.lb-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.lb-content {
    max-width: 95vw;
    max-height: 90vh;
    position: relative;
}
.lb-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.lb-close, .lb-prev, .lb-next {
    position: absolute;
    background: rgba(255,255,255,0.12);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 10001;
}
.lb-close { right: 12px; top: 12px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-prev:hover, .lb-next:hover, .lb-close:hover { background: rgba(255,255,255,0.22); }
.lb-caption {
    margin-top: 8px;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
}

.section {
    margin-bottom: 50px;
}

.section h2 {
    font-family: var(--font-serif);
    font-size: 2em;
    color: var(--color-primary);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--color-secondary);
    padding-bottom: 10px;
}

.section h3 {
    font-size: 1.4em;
    color: var(--color-primary);
    margin-top: 25px;
    margin-bottom: 15px;
}

.intro-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #3d3d3d;
    margin-bottom: 20px;
    font-style: italic;
}

/* Giustifica il testo nella sezione 'Il Viaggio' per migliorare la leggibilita' sui due lati.
   Usa also hyphens per il supporto alla sillabazione in italiano (document has lang="it"). */
#il-viaggio p,
#il-viaggio .intro-text {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
}

/* Apply same justification to the 'Chi Siamo' section (guide descriptions) */
#chi-siamo p,
#chi-siamo .guide-info p {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
}

.highlights {
    background-color: var(--color-accent);
    padding: 20px;
    border-left: 4px solid var(--color-secondary);
    margin: 20px 0;
    border-radius: 4px;
}

.highlights p {
    margin: 10px 0;
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.pricing-box {
    background-color: white;
    border: 2px solid var(--color-secondary);
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
}

.pricing-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.pricing-item:last-child {
    border-bottom: none;
}

.pricing-item .amount {
    font-weight: bold;
    color: var(--color-primary);
    font-size: 1.1em;
}

/* Cost list styling (used in #costo) */
.cost-list {
    list-style: none;
    padding: 0;
    margin: 18px 0;
    display: grid;
    gap: 12px;
}
.cost-list li {
    background: white;
    border: 2px solid var(--color-secondary);
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

@media (min-width: 700px) {
    .cost-list { grid-template-columns: repeat(2, 1fr); }
    .cost-list li { justify-content: space-between; }
}

.guide-card {
    background-color: white;
    border: 1px solid var(--color-border);
    padding: 20px;
    margin: 15px 0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.guide-photo {
    margin-top: 12px;
}
.guide-photo img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--color-border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Make guide card layout horizontal with thumbnail on the left */
.guide-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.guide-info {
    flex: 1 1 auto;
}

.guide-card h4 {
    color: var(--color-secondary);
    font-size: 1.2em;
    margin-bottom: 8px;
}

.guide-card .role {
    font-weight: bold;
    color: var(--color-primary);
    font-style: italic;
}

.contact-info {
    background-color: var(--color-primary);
    color: white;
    padding: 25px;
    border-radius: 6px;
    margin: 30px 0;
}

.contact-item {
    margin: 12px 0;
    font-size: 1em;
}

.contact-item strong {
    display: block;
    margin-bottom: 5px;
}

/* Contact icon (phone) styling: use currentColor-aware SVG and a visible contrast color */
.contact-line {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.contact-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    color: var(--color-secondary); /* lighter tan for good contrast on dark background */
    flex: 0 0 auto;
    vertical-align: middle;
}
.contact-line a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
.contact-line a:hover { text-decoration: underline; }

.note {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 0.95em;
}

.program-day {
    background-color: white;
    border-left: 4px solid var(--color-secondary);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.program-day strong {
    color: var(--color-primary);
    display: block;
    margin-bottom: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: var(--color-primary);
    color: white;
    font-weight: bold;
}

tr:hover {
    background-color: var(--color-accent);
}

footer {
    background-color: var(--color-primary);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    border-top: 4px solid var(--color-secondary);
}

footer p {
    margin: 10px 0;
}

.btn {
    display: inline-block;
    background-color: var(--color-secondary);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 5px;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

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

/* Bottom photo centered */
.bottom-photo {
    text-align: center;
    margin: 30px 0 10px;
}
.bottom-photo img {
    max-width: 85%; /* increased per request */
    width: 85%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

@media (max-width: 700px) {
    .guide-inner { flex-direction: column; align-items: flex-start; }
    .guide-photo img { width: 100px; height: 100px; }
    .bottom-photo img { max-width: 100%; width: 100%; }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .section h2 {
        font-size: 1.5em;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav a {
        padding: 10px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .container {
        padding: 20px 15px;
    }
}
