/* CSS Variables from site.yaml and layout-spec.yaml */
:root {
    /* Colors */
    --color-primary: #003366;
    --color-primary-rgb: 0, 51, 102;
    --color-secondary: #050A10;
    --color-accent: #2B2E33;
    --color-bg: #6A7078;
    --color-text: #050A10;
    --color-white: #ffffff;
    --color-light-gray: #f5f5f5;

    /* Typography - Scaled Down */
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-accent: 'Lora', serif;

    /* Type Scale - Compressed */
    --h1-size: clamp(28px, 4vw, 42px);
    --h2-size: clamp(22px, 3vw, 32px);
    --h3-size: clamp(18px, 2vw, 24px);
    --body-size: clamp(14px, 1.1vw, 16px);
    --small-size: 13px;

    /* Layout - High Density */
    --max-width: 1200px;
    --header-height: 60px;
    --section-padding: clamp(16px, 2vw, 32px);
    --content-gap: clamp(12px, 1.5vw, 20px);
    --grid-gap: 16px;
}

/* Reset & Base */
html,
body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.4;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.1;
}

h1 {
    font-size: var(--h1-size);
    font-weight: 700;
}

h2 {
    font-size: var(--h2-size);
    font-weight: 500;
}

h3 {
    font-size: var(--h3-size);
    font-weight: 500;
}

p {
    font-size: var(--body-size);
    margin-bottom: 0.8em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

ul {
    padding-left: 1.25em;
    margin-bottom: 12px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 16px 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: #002244;
    border-color: #002244;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
}

.btn-link {
    padding: 0;
    border: none;
    background: none;
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: underline;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--color-primary);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand img {
    height: 40px;
    width: auto;
}

.desktop-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.desktop-nav a {
    color: var(--color-white);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
}

.desktop-nav a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-toggle .bar {
    width: 24px;
    height: 3px;
    background-color: var(--color-white);
    border-radius: 2px;
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-primary);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-nav-overlay.active {
    transform: translateX(0);
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.mobile-nav li {
    margin-bottom: 20px;
}

.mobile-nav a {
    color: var(--color-white);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

/* Layout & Scroll Snap */
.scroll-container {
    height: auto;
    overflow-y: visible;
    scroll-snap-type: none;
}

.viewport-section {
    min-height: 100vh;
    max-height: 1000vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: calc(var(--section-padding) + var(--header-height));
    padding-bottom: var(--section-padding);
    padding-left: 0;
    padding-right: 0;
    position: relative;
    box-sizing: border-box;
}

/* Section Specifics */
.section-hero {
    text-align: center;
    background-image: linear-gradient(rgba(0, 51, 102, 0.8), rgba(0, 51, 102, 0.5));
    background-size: cover;
    background-position: center;
    color: var(--color-white);
}

.section-hero h1,
.section-hero h2,
.section-hero p {
    color: var(--color-white);
}

.section-hero hr {
    border-color: rgba(255, 255, 255, 0.3);
}

.section-hero .btn-link {
    color: var(--color-white);
}

.section-hero .btn-secondary {
    color: var(--color-white);
    border-color: var(--color-white);
}

.section-hero .btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.section-about {
    background-color: var(--color-light-gray);
}

.section-kylon {
    background-color: var(--color-white);
}

.section-departments {
    background-color: var(--color-light-gray);
}

.section-resources {
    background-color: var(--color-white);
}

.section-media {
    background-color: var(--color-light-gray);
}

.section-order {
    background-color: var(--color-white);
}

.section-contact {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.section-contact h1,
.section-contact h2,
.section-contact h3,
.section-contact p,
.section-contact a {
    color: var(--color-white);
}

.section-contact hr {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Image Utilities */
.section-image {
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.department-logo {
    max-height: 50px;
    margin-bottom: 12px;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

.media-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Kylon Specific Layout */
.kylon-layout {
    display: grid;
    gap: 20px;
}

@media (min-width: 900px) {
    .kylon-layout {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

/* Grids */
.specialties-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.specialty-item {
    flex: 1 1 180px;
}

.grid-layout,
.media-grid,
.order-grid,
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
}

@media (min-width: 768px) {

    .grid-layout,
    .media-grid,
    .order-grid,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-hero .cta-group {
        display: flex;
        justify-content: center;
        gap: 12px;
    }
}

@media (min-width: 1200px) {
    .grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Cards */
.card,
.department-card,
.order-card,
.media-item,
.contact-block {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
}

.department-card {
    align-items: center;
    text-align: center;
}

.department-card .btn-link {
    margin-top: auto;
}

.section-contact .contact-block {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.card:hover,
.department-card:hover,
.order-card:hover {
    transform: translateY(-3px);
}

/* Footer */
.site-footer {
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 32px 0 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.footer-col h3 {
    color: var(--color-white);
    font-size: 16px;
    margin-bottom: 12px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: #a0a0a0;
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--color-white);
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 12px;
    color: #888;
}

.footer-logo {
    max-width: 120px;
    margin-bottom: 12px;
    filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Responsive Nav */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }
}

@media (min-width: 769px) {
    .mobile-nav-overlay {
        display: none !important;
    }
}