/* ==========================================================================
   STYLE.CSS — VirtualHeritage UNIFE
   Structure:
   1. Fonts
   2. CSS Variables
   3. Base / Reset
   4. Typography
   5. Links
   6. Layout Utilities
   7. Site Header & Nav
   8. Site Footer
   9. Buttons
   10. Grid
   11. Timeline / Leaf Component
   12. Content Sections
   13. References
   14. Responsive
   ========================================================================== */


/* ==========================================================================
   1. FONTS
   ========================================================================== */

@font-face {
    font-family: "Helvetica World";
    src: url("https://virtualheritage.unife.it/assets/fonts/helvetica-world-regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
}


/* ==========================================================================
   2. CSS VARIABLES
   ========================================================================== */

:root {
    --color-primary: #0B6978;
    --color-primary-alt: #1a7d88;
    --color-accent: #5EAAB8;
    --color-accent-dark: #60acbe;
    --color-text: #111;
    --color-text-muted: #333;
    --color-border: #cecece;
    --color-nav-bg: #CCC;
    --color-footer-bg: #5EAAB8;

    --leaf-light: #7bbf76;
    --leaf-medium: #23723a;
    --leaf-dark: #1e3f24;

    --font-base: "Helvetica World", "Helvetica", serif;
    --font-size-base: 18px;
    --line-height-base: 1.5;
}


/* ==========================================================================
   3. BASE / RESET
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font: 400 var(--font-size-base) / var(--line-height-base) var(--font-base);
    color: var(--color-text);
    background-color: #fff;
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    font-kerning: normal;
    font-feature-settings: "kern" 1;
}


/* ==========================================================================
   4. TYPOGRAPHY
   ========================================================================== */

.home-h1 {
    font-size: 75px;
    font-weight: bold;
    text-align: center;
}

.header-h1 {
    font-size: 50px;
    font-weight: bold;
    margin-top: 20px;
}

.header-h2 {
    font-size: 35px;
    font-weight: bold;
    margin-top: 20px;
}


/* ==========================================================================
   5. LINKS
   ========================================================================== */

a {
    color: var(--color-primary) !important;
    text-decoration: underline;
    font-weight: bold;
}

.site-header a {
    text-decoration: none;
}

.site-header .active {
    text-decoration: underline;
}

.site-header .wrapper>* {
    padding: 0;
}


/* ==========================================================================
   6. LAYOUT UTILITIES
   ========================================================================== */

.twothird {
    width: 66.666%;
    flex: 0 0 66.666%;
}

.onethird {
    width: 33.333%;
    flex: 0 0 33.333%;
    padding-left: 1.5rem;
}

.site-page-pagination {
    display: none;
}


/* ==========================================================================
   7. SITE HEADER & NAV
   ========================================================================== */

.site-nav {
    background-color: var(--color-nav-bg);
    color: #fff;
}

.site-title img {
    margin: 0;
    width: 100%;
    height: auto;
}


/* ==========================================================================
   8. SITE FOOTER
   ========================================================================== */

.site-footer,
.site-footer.h-card {
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    padding: 20px;
    width: 100%;
    margin: 0;
}

.site-footer.h-card .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-footer.h-card a {
    color: #fff !important;
    text-decoration: none;
    font-size: var(--font-size-base);
    font-family: Arial, sans-serif;
    font-weight: normal;
}

.site-footer.h-card a:hover {
    text-decoration: underline;
}

.site-footer.h-card .wrapper div[style*="display: flex"] {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.site-footer.h-card .wrapper div a strong[style*="color: black"] {
    color: #fff !important;
    font-weight: normal !important;
}


/* ==========================================================================
   9. BUTTONS
   ========================================================================== */

.button-link {
    display: block;
    width: fit-content;
    margin: 50px auto 0;
    padding: 8px 20px;
    border: 2px solid var(--color-primary-alt);
    border-radius: 10px;
    color: var(--color-primary-alt);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.button-link:hover {
    background-color: var(--color-primary-alt);
    color: #fff;
}


/* ==========================================================================
   10. GRID
   ========================================================================== */

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-item img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.grid-item h2 {
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
}

.grid-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: var(--color-text) !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.grid-item a:hover {
    transform: translateY(-5px);
    opacity: 0.9;
}


/* ==========================================================================
   11. TIMELINE / LEAF COMPONENT
   ========================================================================== */

.timeline-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
}

.leaf-container {
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    position: relative;
}

.leaf {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.leaf-left {
    transform: rotate(-45deg);
}

.leaf-right {
    transform: rotate(45deg);
}

.leaf-light {
    fill: var(--leaf-light);
}

.leaf-medium {
    fill: var(--leaf-medium);
}

.leaf-dark {
    fill: var(--leaf-dark);
}

.timeline-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.timeline-years {
    font-size: 16px;
    color: var(--color-text-muted);
}


/* ==========================================================================
   12. CONTENT SECTIONS
   ========================================================================== */

.content-section {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 40px 0;
    position: relative;
}

.text-column {
    flex: 1;
    min-width: 300px;
}

.text-column p {
    margin-bottom: 20px;
}

.leaf-column {
    flex: 0 0 auto;
    width: 180px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
}


/* ==========================================================================
   13. REFERENCES & FOOTNOTES
   ========================================================================== */

.footnotes {
    color: var(--color-primary);
}

.references small {
    color: var(--color-primary);
}


/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .timeline-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile landscape */
@media (max-width: 768px) {
    .grid-container.psife-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-section {
        flex-direction: column-reverse;
    }

    .leaf-column {
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }

    .text-column,
    .twothird,
    .onethird {
        width: 100%;
        flex: 0 0 100%;
        padding-left: 0;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .grid-container.psife-grid {
        grid-template-columns: 1fr;
    }

    .grid-item h2 {
        font-size: 18px;
    }

    .timeline-container {
        grid-template-columns: 1fr;
    }
}