*,
::before,
::after {
    box-sizing: border-box;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif, Apple Color Emoji, "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); 
    line-height: 1.6;
    color: #333;
}

body {
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(16px, 2vw, 24px);
    display: grid;
    gap: clamp(24px, 4vw, 48px);
    grid-template-rows: min-content 1fr min-content;
    background-color: #f9f9f9;
}

a {
    color: currentColor;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

header {
    border-bottom: 1px solid #ccc;
}

picture {
    display: block;
}

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

.navbar-brand {
    font-family: 'Lobster', cursive;
    font-size: 2rem;
}

footer {
    border-top: 2px solid #ccc;
    text-align: center;
    padding: clamp(24px, 3vw, 48px) 0;
    margin-top: auto;
    font-size: 0.9em;
    color: #666;
}

.socials svg {
    width: 2em;
    height: 2em;
    display: block; /* Removes extra whitespace below inline SVGs */
    fill: currentColor; /* Optional: Makes icon inherit text color */
}

/* Add space BETWEEN icons, not inside them */
.socials a {
    margin-right: 0.5em; /* Adjust spacing as needed */
    display: inline-block; /* Ensures margin works correctly */
}

/* Remove margin from the last icon */
.socials a:last-child {
    margin-right: 0;
}

.carousel-caption {
    background: rgba(0,0,0,0.5);
    padding: 1rem;
    border-radius: 8px;
    bottom: 10%;
}

.carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.carousel-caption p {
  margin-bottom: 1rem;
}

.carousel-caption .btn {
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
}

/* Hero CTA Button Styling */
.hero-cta {
  background: linear-gradient(45deg, #bb2e2e, #ee8924); /* Gradient Background */
  border: none;
  color: white;
  padding: 12px 30px;
  font-weight: 600;
  /* text-transform: uppercase; */
  letter-spacing: 1px;
  border-radius: 50px; /* Pill shape */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Drop shadow */
  transition: all 0.3s ease; /* Smooth animation */
  text-decoration: none !important;
}

/* Hover Effect */
.hero-cta:hover {
  transform: translateY(-3px); /* Lifts button up */
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* Larger shadow */
  background: linear-gradient(45deg, #ee8924, #bb2e2e); /* Reverse gradient */
  color: white;
}

/* Focus State (Accessibility) */
.hero-cta:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* --- HERO SECTION (New Implementation) --- */
/* Targets the homepage specifically */
.template-homepage main {
    text-align: center;
    display: grid;
    gap: clamp(24px, 4vw, 48px);
}

/* If you add a .hero class to your homepage main or a section within it */
.hero {
    position: relative;
    /* Updated: Uses dynamic viewport height minus header approx */
    min-height: clamp(60vh, 50vw, 80vh);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    color: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: clamp(24px, 4vw, 48px);
}

.hero-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    z-index: -1; /* Behind content */
    opacity: 0.7;
}

.hero-image img {
    width: 100%;
    height: 100%;
    max-width: 100%; /* CRITICAL: Prevents intrinsic size from breaking flex */
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: clamp(24px, 4vw, 48px);
    max-width: 800px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border-radius: 8px;
}

/* Fluid Typography for Headings */
.hero-title {
    font-family: 'Lobster', cursive;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 16px 0;
    font-weight: 800;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
    margin: 0;
}

/* --- STANDARD PAGE CONTENT --- */
/* General headings outside hero */
h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.3;
    margin-top: 1.5em;
}

/* Intro text common in Wagtail tutorials */
.intro {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: #555;
    max-width: 700px;
    margin: 0 auto 2em;
}

/* --- ACCESSIBILITY --- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus-visible {
    top: 10px;
}

/* --- FORMS --- */
.page-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: clamp(24px, 4vw, 48px);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-form label {
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.page-form :is(textarea, input, select) {
    width: 100%;
    max-width: 100%; /* Removed fixed 500px for better mobile flow */
    min-height: 48px; /* Improved touch target */
    margin-top: 4px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.page-form .helptext {
    font-style: italic;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 16px;
    display: block;
}

@media (max-width: 600px) {
    body {
        grid-template-rows: min-content auto min-content;
    }
    
    .hero {
        min-height: 50vh;
    }

    .carousel-caption {
        position: static;
        width: 100%;
        text-align: center;
        padding: 0.5rem;
        background: rgba(0,0,0,0.7);
        padding-bottom: 4rem;
        border-radius: 0px;
    }

    .carousel-caption h2 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
}   