@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&family=Special+Elite&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    color: #111111;
    background-color: #fff;
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
}

/* Container for page content */
.content {
    padding: 0 40px; 
    max-width: 1200px;
    margin: 0 auto;
}

.content figure {
    text-align: center;
}

.content figcaption {
    margin-top: 0.5rem;
}

/* Images in the main body of pages (not hero elements) */
.content picture,
.content picture img {
    max-width: 100%;
    max-height: 600px; /* Prevents images from filling the page */
    height: auto;
    display: block;
    margin: 0 auto; /* Centres the image */   
}

.content video {
    max-width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Colour variables to save having to refer to the hex codes each time they are used */
:root {
    --hungary-red: #CD2A3E;
    --hungary-white: #FFFFFF;
    --hungary-green: #436F4D; /* this is rarely used, as red and green together can cause accessibility issues for colour-blind users */
}

/* Hero elements */
.hero {
    position: relative;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--hungary-white);
    overflow: hidden;
}

.hero img {
    position: absolute;
    object-position: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(60%);
    z-index: 0;
}

.hero .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0, 0, 0, 0.4),
        rgba(0, 0, 0, 0.4)
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 3rem;
    font-family: 'Georgia', serif;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.hero p {
    font-size: 1.3rem;
    margin: 1rem 0;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

/* Nav bar */
.site-nav {
    background-color: var(--hungary-red);
    color: var(--hungary-white);
    padding: 10px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center
}

.site-nav .nav-links {
    display: flex;
    gap: 10px;
}

.site-nav .nav-links a {
    color: var(--hungary-white);
    text-decoration: none;
    padding: 0.5em 0.75em;
}

.site-nav .nav-links a.active {
    background-color: var(--hungary-white);
    color: var(--hungary-red);
    border-radius: 4px;
}

/* Hide the burger menu on desktop */
.site-nav .nav-toggle {
    display: none;
}

.site-nav .nav-toggle-label,
.site-nav .nav-current {
    display: none;
}

/* Expanding link strip */
.expanding-links {
    display: flex;
    gap: 10px;
    align-items: stretch;
    justify-content: stretch;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 10px;
}

.expanding-links .tile {
    position: relative;
    flex: 1 1 0;
    min-height: 220px;
    overflow: hidden;
    text-decoration: none;
    color: var(--hungary-white);
    outline: none;
    transition: flex-grow 0.5s ease, transform 0.5s ease;
}

.expanding-links .tile .tile-content {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    pointer-events: none; /* Makes the whole tile a link */
}

.expanding-links .tile h3 {
    z-index: 2;
}

.expanding-links .tile p {
    z-index: 2;
}

/* Set widths equally, then expand on hover */
.expanding-links:hover .tile {
    flex-grow: 1;
}

.expanding-links:hover .tile:hover {
    flex-grow: 3;
}

.expanding-links .tile:focus {
    flex-grow: 3;
}

.expanding-links .tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.75);
    transition: filter 0.4s ease;
}

.expanding-links .tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--hungary-red);
    z-index: 1;
}

.expanding-links .tile .more {
    max-width: 4ch;
    margin: 0 auto;
    line-height: 1.5;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease;
}

/* Show more text when expanded */
.expanding-links:hover .tile:hover .more,
.expanding-links .tile:focus .more {
    opacity: 1;
    max-height: 12rem;
    min-width: 200px;
}

/* Background images for tiles */
.expanding-links .tile.summary::before {
    background-image: url('assets/images/black-white-flag-1956.jpg');
}


/* Page cards */
.page-cards {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--hungary-white);
}

.page-cards h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--hungary-red);
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.card h3 {
    color: var(--hungary-red);
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 0.95rem;
    line-height: 1.4;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    background-color: #fff;
}

/* Typewriter style for quotes */
.typewriter {
    background-color: #f8f8f8;
    border: 1px solid #aaa;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    line-height: 1.6;
    color: #111;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}

/* Timeline */
/* Size variables */
:root {
    --tl-line-w: 6px;
    --tl-dot: 25px;
    --tl-dot-border: 4px;
    --tl-dot-total: calc(var(--tl-dot) + 2 * var(--tl-dot-border));
}

/* Vertical rule */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.timeline::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--tl-line-w);
    margin-left: calc(-1 * var(--tl-line-w) / 2);
    background: var(--hungary-red);
    border-radius: 999px;
}

/* Container around text */
.container {
    position: relative;
    width: 50%;
    padding: 10px 40px;
    background: transparent;
    box-sizing: border-box;
}

/* Left item placement */
.left {
    left: 0;
}

/* Right item placement */
.right {
    left: 50%;
}

/* Circles on the timeline */
.container::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: var(--tl-dot);
    height: var(--tl-dot);
    background: var(--hungary-white);
    border: var(--tl-dot-border) solid var(--hungary-red);
    border-radius: 50%;
    z-Index: 2;
}

.left::after {
    right: calc(-1 * var(--tl-dot-total) / 2);
}

.right::after {
    left: calc(-1 * var(--tl-dot-total) / 2);
}

.content {
    padding: 20px 30px;
    background-color: var(--hungary-white);
    position: relative;
    border-radius: 6px;
    z-index: 1;
}

/* Sixteen points section */
/* Two-column layout for Sixteen Points + image */
.points-layout {
  display: grid;
  grid-template-columns: 1fr 360px; /* content left, image right */
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
}

.points-image figure { margin: 0; }
.points-image img { 
    display: block; 
    width: 100%; 
    height: auto; 
}

.points-image figcaption { 
    font-size: 0.9rem; 
    margin-top: 0.5rem; 
    color: #444; 
}

/* Tidy the list items */
.points-list .point {
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

a {
    color: var(--hungary-red);              
    text-decoration: none; /* Remove default underline */
    font-weight: 600;                       
}

iframe {
    max-width: 100%;
    width: 100%;
    border: 0;
}

/* Resize for smaller laptop screens */
@media (max-width: 1024px)
    {
    .content{
        padding: 0 20px;
    }


    nav {
        flex-wrap: wrap;
    }

    nav a {
        padding: 0.75em 0.5em;
        margin: 0 5px;
        font-size: 0.9rem;
    }

    .hero {
        height: 50vh;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .expanding-links {
        padding: 0 5px;
    }
}

/* Sizing for smaller (mobile) screens */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    .content {
        padding: 0 15px;
    }

    /* Change nav to burger menu */
    .site-nav {
        justify-content: space-between;
        flex-wrap: wrap;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .site-nav .nav-top {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .site-nav .nav-toggle-label,
    .site-nav .nav-current {
        display: inline-flex;
        align-items: center;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80%;
    }

    .site-nav .nav-toggle-label {
        display: inline-flex;
        font-size: 1.6rem;
        cursor: pointer;
    }

    /* Hide links on mobile */
    .site-nav .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 8px;
    }

    .site-nav .nav-links a {
        text-align: center;
        padding: 0.6em 0.3em;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    .site-nav .nav-toggle:checked ~ .nav-links {
        display: flex;
    }
    
    .hero {
        height: 45vh;
    }

    .hero-content {
        padding: 10px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .expanding-links {
        flex-direction: column;
        max-width: 600px;
        padding: 0 10px;
    }

    .expanding-links .tile {
        flex: 1 1 auto;
        min-height: 140px;
    }

    .expanding-links:hover .tile,
    .expanding-links:hover .tile:hover,
    .expanding-links .tile:focus {
        flex-grow: 1;
    }

    .expanding-links .tile .more {
        opacity: 1;
        max-height: none;
        max-width: 100%;
        overflow: visible;
    }

    .timeline::after {
        left: 15px;
    }

    .timeline .container {
        width: 100%;
        padding-left: 40px;
        padding-right: 15px;
        left: 0;
    }

    .timeline .right {
        left: 0;
    }

    .timeline .container::after {
        left: 0;
        right: auto;
    }

    /* Sixteen points */
    .points-layout {
        grid-template-columns: 1fr;
    }
}