/* Carottes Grillées - Sidebar Layout */

:root {
    --color-orange: #E67E22;
    --color-orange-dark: #D35400;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-link: #E67E22;
    --color-bg: #ffffff;
    --color-border: #cccccc;

    --font-body: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    --font-serif: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;

    --sidebar-width: 200px;
    --max-width: 1000px;
    --spacing: 1.5rem;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-orange);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Base */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Site wrapper */
.site-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
}

/* Header */
.site-header {
    padding: 1rem 0 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-image {
    height: 120px;
    width: auto;
}

/* Title text is in the logo image, so hide the separate span */
.site-title {
    display: none;
}

/* Layout - Two column grid */
.site-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar Navigation */
.sidebar-nav {
    position: sticky;
    top: 1rem;
}

.nav-list {
    list-style: none;
    border-top: 1px solid var(--color-border);
}

.nav-item {
    border-bottom: 1px solid var(--color-border);
}

.nav-item a {
    display: block;
    padding: 0.4rem 0;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-item a:hover,
.nav-item a:focus {
    color: var(--color-orange);
}

.nav-item.active > a {
    color: var(--color-orange);
    font-weight: 600;
}

/* Submenu's */
.nav-submenu {
    list-style: disc;
    padding-left: 1.2rem;
    margin: 0.25rem 0;
}

.nav-submenu .nav-item {
    border-bottom: none;
}

.nav-submenu .nav-item a {
    padding: 0.2rem 0;
    font-size: 0.9rem;
}

/* Nested submenu's (level 3+) */
.nav-submenu .nav-submenu {
    padding-left: 1rem;
}

/* Focus styles */
a:focus,
button:focus {
    outline: 2px solid var(--color-orange);
    outline-offset: 2px;
}

/* Mobile menu toggle - hidden on desktop */
.menu-toggle {
    display: none;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    text-align: left;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
}

.breadcrumbs a {
    color: var(--color-link);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span[aria-hidden] {
    margin: 0 0.5rem;
    color: var(--color-orange);
}

/* Main content */
.main-content {
    min-height: 50vh;
}

/* Page titles */
.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-orange);
    margin: 0 0 0.5rem 0;
    padding: 0;
    line-height: 1.2;
}

/* Prose content */
.prose {
    max-width: 65ch;
}

.prose p {
    margin-bottom: 1rem;
}

/* Remove top margin from first element after title */
.content-body > *:first-child {
    margin-top: 0;
}

.content-body > h1 + * {
    margin-top: 0;
}

.prose a {
    color: var(--color-link);
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

.prose strong {
    color: var(--color-text);
}

.prose em {
    font-style: italic;
}

.prose blockquote {
    border-left: 3px solid var(--color-orange);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.prose img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

/* Poetry */
.poem {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 55ch;
}

/* Content with section image sidebar */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1rem;
    align-items: start;
    margin-top: 0;
}

.section-image {
    order: 2;
    padding: 0 0.5rem;
}

.section-image img {
    width: 100%;
    height: auto;
    max-width: 180px;
    display: block;
    margin-left: auto;
}

.content-body {
    order: 1;
    margin: 0;
    padding: 0;
}

/* When no section image, content takes full width */
.content-with-sidebar:not(:has(.section-image)) {
    display: block;
}

.content-with-sidebar.poem .content-body {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-with-sidebar.poem .content-body p {
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

/* Override max-width for content-with-sidebar */
.content-with-sidebar.prose {
    max-width: none;
}

.content-with-sidebar.poem {
    max-width: none;
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Page list */
.page-list {
    list-style: disc;
    padding-left: 1.5rem;
}

.page-list li {
    margin-bottom: 0.25rem;
}

.page-list a {
    color: var(--color-text);
    text-decoration: none;
}

.page-list a:hover {
    color: var(--color-orange);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 800px) {
    :root {
        --sidebar-width: 170px;
    }

    .logo-image {
        height: 80px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .site-layout {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar-nav {
        display: none;
        position: static;
        margin-bottom: 1.5rem;
    }

    .sidebar-nav.is-open {
        display: block;
    }

    .logo-image {
        height: 60px;
    }

    .poem {
        font-size: 1rem;
    }

    /* Section image below content on mobile */
    .content-with-sidebar {
        display: block;
    }

    .section-image {
        margin-top: 2rem;
        max-width: 150px;
    }
}

/* Small mobile */
@media (max-width: 400px) {
    :root {
        --spacing: 1rem;
    }

    .logo-image {
        height: 50px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar-nav,
    .menu-toggle,
    .skip-link {
        display: none;
    }

    .site-layout {
        display: block;
    }

    .site-footer {
        border: none;
        margin-top: 2rem;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
