/* ============================================================
   FHW Modern – Joomla 6 Template
   Ferienhilfswerk Xanten
   ============================================================ */

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

:root {
    --blue-dark:   #1a3a6b;
    --blue-mid:    #2563ab;
    --blue-light:  #e8f0fb;
    --accent:      #e8a020;
    --text:        #2c2c2c;
    --text-muted:  #666;
    --border:      #dde4f0;
    --white:       #ffffff;
    --bg:          #f5f7fc;
    --radius:      6px;
    --shadow:      0 2px 12px rgba(26,58,107,.10);
    --transition:  .22s ease;
    --content-width: 1100px;
    --wide-width:    1540px; /* content + 40% */
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}

a { color: var(--blue-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout Container --- */
.fhw-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   HEADER
   ============================================================ */
.fhw-header {
    background: var(--blue-dark);
    box-shadow: 0 6px 24px rgba(26,58,107,.35), 0 2px 6px rgba(0,0,0,.2);
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: var(--wide-width);
    margin: 0 auto;
    margin-bottom: 20px;
    border-radius: 0 0 var(--radius) var(--radius);
}

.fhw-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 20px;
}

.fhw-logo { display: flex; align-items: center; flex-shrink: 0; }
.fhw-logo a { display: flex; }
.fhw-logo img { height: 44px; width: auto; }

/* --- Navigation --- */
.fhw-nav { display: flex; align-items: center; }

/* Joomla generates a <ul> inside the nav module */
.fhw-nav ul,
.fhw-nav .nav-pills,
.fhw-nav .nav {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.fhw-nav ul li a,
.fhw-nav ul li span {
    display: block;
    color: rgba(255,255,255,.85);
    font-size: .93rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.fhw-nav ul li a:hover,
.fhw-nav ul li.active > a,
.fhw-nav ul li.current > a {
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
}

.fhw-nav ul li.active > a { background: var(--blue-mid); }

/* Hamburger button */
.fhw-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.fhw-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================================
   HERO SLIDER
   ============================================================ */
.fhw-slider {
    position: relative;
    width: 100%;
    max-width: var(--wide-width);
    margin: 0 auto;
    height: 380px;
    overflow: hidden;
    background: var(--blue-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.fhw-slider-track {
    position: relative;
    height: 100%;
}

.fhw-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .7s ease;
}
.fhw-slide.active { opacity: 1; }
.fhw-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.fhw-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    padding: 10px 16px;
    cursor: pointer;
    z-index: 10;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.fhw-slider-btn:hover { background: rgba(0,0,0,.7); }
.fhw-slider-prev { left: 16px; }
.fhw-slider-next { right: 16px; }

.fhw-slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}
.fhw-slider-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    border: none;
    transition: background var(--transition);
}
.fhw-slider-dots .dot.active { background: #fff; }

/* ============================================================
   MAIN LAYOUT (2-col: content + sidebar)
   ============================================================ */
.fhw-main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    padding-top: 32px;
    padding-bottom: 40px;
    align-items: start;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.fhw-content {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    min-width: 0;
}

.fhw-content h1 { font-size: 1.7rem; color: var(--blue-dark); margin-bottom: 16px; line-height: 1.3; }
.fhw-content h2 { font-size: 1.35rem; color: var(--blue-dark); margin: 24px 0 12px; }
.fhw-content h3 { font-size: 1.1rem; color: var(--blue-mid); margin: 20px 0 10px; }
.fhw-content p   { margin-bottom: 14px; }
.fhw-content ul,
.fhw-content ol  { margin: 0 0 14px 24px; }
.fhw-content hr  { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Joomla article info bar */
.fhw-content .article-info,
.fhw-content .page-header { display: none; }

/* System messages */
.fhw-content .alert         { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.fhw-content .alert-message { background: #e8f4fb; border-left: 4px solid var(--blue-mid); color: var(--blue-dark); }
.fhw-content .alert-error   { background: #fef2f2; border-left: 4px solid #e53e3e; color: #742a2a; }

/* Breadcrumbs */
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--text-muted); }
.breadcrumb li::after { content: '›'; margin-left: 6px; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb a { color: var(--blue-mid); }

/* Image floats from WYSIWYG */
.fhw-content img[style*="float: right"],
.fhw-content img[style*="float:right"] { margin: 0 0 12px 20px; border-radius: var(--radius); }
.fhw-content img[style*="float: left"],
.fhw-content img[style*="float:left"]  { margin: 0 20px 12px 0; border-radius: var(--radius); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.fhw-sidebar { min-width: 0; }

.fhw-sidebar .moduletable {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.fhw-sidebar .moduletable h3,
.fhw-sidebar .moduletable .module-title {
    background: var(--blue-dark);
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    padding: 10px 16px;
    margin: 0;
    letter-spacing: .02em;
}

.fhw-sidebar .moduletable > div { padding: 8px 0; }

.fhw-sidebar .moduletable ul { list-style: none; }

.fhw-sidebar .moduletable ul li a {
    display: flex;
    align-items: center;
    padding: 7px 16px;
    color: var(--text);
    font-size: .9rem;
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.fhw-sidebar .moduletable ul li a::before {
    content: '›';
    margin-right: 8px;
    color: var(--blue-mid);
    font-weight: bold;
}

.fhw-sidebar .moduletable ul li a:hover,
.fhw-sidebar .moduletable ul li.active > a {
    background: var(--blue-light);
    color: var(--blue-dark);
    border-left-color: var(--blue-mid);
}

.fhw-sidebar .moduletable ul li.active > a {
    font-weight: 600;
    border-left-color: var(--blue-dark);
}

/* ============================================================
   FOOTER
   ============================================================ */
.fhw-footer {
    background: var(--blue-dark);
    color: rgba(255,255,255,.75);
    font-size: .88rem;
    padding: 20px 0;
    text-align: center;
    margin-top: 10px;
}

.fhw-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.fhw-footer a { color: rgba(255,255,255,.9); }
.fhw-footer a:hover { color: #fff; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, .button {
    display: inline-block;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
}
.btn-primary { background: var(--blue-mid); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .fhw-main { grid-template-columns: 1fr; }
    .fhw-sidebar { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .fhw-sidebar .moduletable { margin-bottom: 0; }
    .fhw-slider { height: 260px; }
}

@media (max-width: 640px) {
    .fhw-header,
    .fhw-slider { border-radius: 0; }
    .fhw-header-inner { padding: 0 16px; min-height: 60px; }
    .fhw-logo img { height: 36px; }
    .fhw-hamburger { display: flex; }
    .fhw-nav { position: relative; }
    .fhw-nav > *:not(.fhw-hamburger) {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: -16px;
        background: var(--blue-dark);
        padding: 8px 0 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,.3);
        min-width: 200px;
        border-radius: 0 0 var(--radius) var(--radius);
    }
    .fhw-nav.open > *:not(.fhw-hamburger) { display: block; }
    .fhw-nav ul { flex-direction: column; gap: 0; padding: 0 12px; }
    .fhw-nav ul li a { padding: 10px 12px; white-space: normal; }
    .fhw-content { padding: 20px 16px; }
    .fhw-slider { height: 200px; }
    .fhw-slider-btn { font-size: 1.5rem; padding: 8px 12px; }
    .fhw-sidebar { grid-template-columns: 1fr; }
    .fhw-main { padding-top: 20px; gap: 20px; }
}

/* ============================================================
   IMAGE GALLERY
   ============================================================ */
.fhw-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    margin: 1.5rem 0;
}

.fhw-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 4/3;
}

.fhw-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease, opacity .2s;
    cursor: pointer;
}

.fhw-gallery-item:hover img {
    transform: scale(1.04);
    opacity: .9;
}

/* Lightbox */
.fhw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fhw-lightbox[hidden] { display: none; }

.fhw-lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 4px 32px rgba(0,0,0,.6);
    display: block;
}

.fhw-lb-btn {
    position: absolute;
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    padding: .4rem .75rem;
    border-radius: var(--radius);
    transition: background .2s;
}
.fhw-lb-btn:hover { background: rgba(255, 255, 255, .3); }

.fhw-lb-close  { top: 1rem; right: 1rem; font-size: 1.1rem; }
.fhw-lb-prev   { left: 1rem;  top: 50%; transform: translateY(-50%); }
.fhw-lb-next   { right: 1rem; top: 50%; transform: translateY(-50%); }

.fhw-lb-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .65);
    font-size: .85rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .fhw-gallery { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
    .fhw-lb-prev { left: .4rem; }
    .fhw-lb-next { right: .4rem; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
