:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #16a085;
    --bg-color: #fdfdfd;
    --text-color: #333;
    --light-gray: #f4f6f7;
    --ochre: #b8860b; /* colore ocra usato per overlay e footer */
    --hero-overlay: rgba(184, 134, 11, 0.6);
    --ochre-dark: #8f5f02; /* versione più scura per hover */
    
    /* Class Colors */
    --vol1-color: #e74c3c;
    --vol2-color: #e67e22;
    --vol3-color: #f1c40f;
    --vol4-color: #27ae60;
    --vol5-color: #2980b9;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Sticky footer: keep footer at bottom on short pages */
html, body {
    height: 100%;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > footer {
    margin-top: auto;
}

header {
    /* Hero with ochre overlay and background image */
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), url('seminatore.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    width: 100%;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
}

/* Home hero: show full image (no cropping) on desktop/tablet */
header.header--home {
    background-size: contain;
    /* seminatore.png is 900x563 => ~62vw height for full image.
       Clamp to avoid becoming too tall on very wide screens. */
    min-height: clamp(50vh, 62vw, 80vh);
}

header h1 {
    font-size: 4rem;
    margin: 0;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
    letter-spacing: 2px;
}

/* Keep header title styling when wrapped in a link */
header h1 a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
header h1 a:hover {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

header p {
    font-size: 1.8rem;
    margin-top: 15px;
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

header p.site-section {
    white-space: pre-line;
}

@media (max-width: 768px) {
    header { min-height: 40vh; }
    header h1 { font-size: 2.5rem; }
    header p { font-size: 1.1rem; }

    /* On phones keep the current cropped hero behavior */
    header.header--home { background-size: cover; }
}

/* Compact header variant for internal/admin pages
   Keep the same hero background but reduce height and font sizes
   so the header appears shorter while preserving visuals. */
header.header--compact {
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), url('seminatore.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    color: #fff;
    min-height: 35vh; /* shorter than full hero */
    padding: 0.5rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    text-align: center;
}
header.header--compact .container { display:block; }
header.header--compact h1 { font-size: 4rem; margin: 0; text-shadow: 2px 2px 5px rgba(0,0,0,0.6); }
header.header--compact h1 a { color: inherit; }
header.header--compact p.site-section { margin: 0; font-size: 1.8rem; color: rgba(255,255,255,0.9); text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }

/* Link class for the Rapporto Tecnico index */
.rt-link {
    color: var(--ochre);
    text-decoration: none;
    font-weight: bold;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Wider container variant (used by materials listing pages) */
.container--wide {
    max-width: 1400px;
}

.intro {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 5px solid var(--ochre);
}

.intro h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.volumes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.volume-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 5px solid transparent;
}

.volume-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.volume-card h3 {
    margin: 0.5rem 0;
    font-size: 1.5rem;
}

.volume-card span {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

/* Specific colors for volumes */
.vol-1 { border-top-color: var(--vol1-color); }
.vol-1 h3 { color: var(--vol1-color); }

.vol-2 { border-top-color: var(--vol2-color); }
.vol-2 h3 { color: var(--vol2-color); }

.vol-3 { border-top-color: var(--vol3-color); }
.vol-3 h3 { color: var(--vol3-color); }

.vol-4 { border-top-color: var(--vol4-color); }
.vol-4 h3 { color: var(--vol4-color); }

.vol-5 { border-top-color: var(--vol5-color); }
.vol-5 h3 { color: var(--vol5-color); }

.testimonials-section {
    background-color: var(--light-gray);
    padding: 3rem 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
}

.testimonials-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.testimonial-card::before {
    content: "“";
    font-size: 4rem;
    color: var(--accent-color);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: serif;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    font-weight: bold;
    color: var(--secondary-color);
    text-align: right;
}

.cta-section {
    text-align: center;
    margin-bottom: 2rem;
}

.btn-review {
    display: inline-block;
    background-color: var(--ochre);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.btn-review:hover {
    background-color: var(--ochre-dark);
    color: white;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--ochre);
    color: #fff;
    font-size: 0.9rem;
}

/* --- COMMON SITE-WIDE COMPONENTS (moved from per-page styles) --- */

/* Global link styles used across pages */
a {
    color: var(--ochre);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover { color: var(--ochre-dark); text-decoration: underline; }

/* Ensure button-like links don't get underlined */
.btn-review, .btn-outline { text-decoration: none; }
.btn-review:hover, .btn-outline:hover { text-decoration: none; }

/* Top navigation used in internal RT pages */
.top-nav {
    background: white;
    border-bottom: 1px solid #ddd;
    padding: 1rem 0;
    text-align: center;
}

.top-nav a {
    margin: 0 15px;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.top-nav a:hover { color: var(--ochre); }

/* Generic card used on many RT pages */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 5px solid var(--ochre);
}

.card h2 {
    color: var(--ochre);
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.5rem;
}

.card h3 {
    color: #555;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Link lists used across RT pages */
ul.link-list { list-style: none; padding: 0; }
ul.link-list li { margin-bottom: 0.5rem; padding-left: 1.5rem; position: relative; }
ul.link-list li::before { content: "•"; color: var(--ochre); font-weight: bold; position: absolute; left: 0; }

/* Make list links blue in Volume I pages only (override global link color) */
body ul.link-list a { color: #0000EE; text-decoration: none; }
body ul.link-list a:hover { color: #0000EE; text-decoration: underline; }

p.link-list a { color: #0000EE; text-decoration: none; }
p.link-list a:hover { color: #0000EE; text-decoration: underline; }


/* Action buttons */
.action-buttons { display: flex; gap: 1rem; margin-bottom: 2rem; justify-content: center; }
.btn-outline {
    border: 2px solid var(--ochre);
    color: var(--ochre);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.btn-outline:hover { background-color: var(--ochre); color: white; text-decoration: none; }

/* Material table style shared across internal pages */
.material-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.material-table th { background-color: #f0f0f0; color: #333; text-align: left; padding: 12px; border-bottom: 2px solid #ddd; }
.material-table td { padding: 12px; border-bottom: 1px solid #eee; }
.material-table tr:hover { background-color: #fff8e1; }

.file-link { background-color: #eee; color: #333; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.file-link:hover { background-color: var(--ochre); color: white; text-decoration: none; }

/* Small responsive tweaks for internal pages */
@media (max-width: 600px) {
    .action-buttons { flex-direction: column; text-align: center; }
    .material-table { display: block; overflow-x: auto; }
}

/* Home: first textual block (was an unstyled <section>) */
.home-lead {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 5px solid var(--ochre);
    padding: 2rem;
    margin-bottom: 2rem;
}
.home-lead ul { margin: 1rem 0 0; }
.home-lead li { margin-bottom: 0.5rem; }

/* RT pages: white Didmat link on hero header */
header .rt-site-home {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}
header .rt-site-home:hover {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

/* RT internal nav + back button wrapper */
.internal-nav {
    margin: 1.25rem 0 1.75rem;
    text-align: center;
}
.internal-nav a {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 30px;
    border: 2px solid var(--ochre);
    color: var(--ochre);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    text-decoration: none;
}
.internal-nav a:hover {
    background-color: var(--ochre);
    color: #fff;
    text-decoration: none;
}

.rt-back {
    text-align: center;
    margin: 0 0 3rem;
}
