/* ===========================================
   Kenmare Pioneer Village — Main Stylesheet
   =========================================== */

/* === Variables === */
:root {
    --color-bg:           #FAF5EC;
    --color-surface:      #FFFDF7;
    --color-surface-alt:  #F0E8D8;
    --color-primary:      #5C3D1E;
    --color-primary-dark: #3E2712;
    --color-sage:         #8FAF80;
    --color-sage-dark:    #6A9060;
    --color-blue:         #9EC4CC;
    --color-tan:          #C4A06A;
    --color-text:         #2C1A0E;
    --color-muted:        #7A5C44;
    --color-border:       #D9C9B0;
    --nav-height:         72px;
    --max-width:          1200px;
    --radius:             8px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Lato', Georgia, sans-serif;
    font-size: 18px;
    line-height: 1.75;
    color: var(--color-text);
    background: var(--color-bg);
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

/* === Typography === */
h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.25;
    color: var(--color-primary);
}
h1 { font-size: 2.8rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.15rem; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
}
.section { padding: 72px 0; }
.section-alt { background: var(--color-surface-alt); }
.section-dark {
    background: var(--color-primary);
    color: #FAF5EC;
}
.section-dark h2 { color: #FAF5EC; }

/* === Navigation === */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-primary);
    box-shadow: 0 2px 14px rgba(44,24,16,0.3);
    height: var(--nav-height);
}
.nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.nav-logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-bg);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
.nav-logo:hover { color: var(--color-tan); }
.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}
.nav-links a {
    color: var(--color-bg);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 4px 0;
    border-bottom: 2.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--color-tan);
    border-bottom-color: var(--color-tan);
}
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(250,245,236,0.4);
    color: var(--color-bg);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    line-height: 1;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 15px 34px;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(44,24,16,0.22); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-primary); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-primary-dark); color: var(--color-bg); }

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2.5px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: var(--color-bg); }

.btn-white { background: var(--color-bg); color: var(--color-primary); }
.btn-white:hover { background: #fff; color: var(--color-primary-dark); }

.btn-white-outline {
    background: transparent;
    color: var(--color-bg);
    border: 2.5px solid var(--color-bg);
}
.btn-white-outline:hover { background: rgba(250,245,236,0.12); color: var(--color-bg); }

.btn-sage { background: var(--color-sage); color: #fff; }
.btn-sage:hover { background: var(--color-sage-dark); color: #fff; }

/* === Homepage Hero === */
.hero {
    min-height: 560px;
    background:
        linear-gradient(160deg, rgba(62,39,18,0.88) 0%, rgba(92,61,30,0.75) 50%, rgba(62,39,18,0.9) 100%),
        url('../images/hero-bg.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 100px 28px;
}
.hero-content { max-width: 720px; margin: 0 auto; }
.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-tan);
    margin-bottom: 18px;
}
.hero-content h1 {
    color: var(--color-bg);
    font-size: 3.2rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.hero-content p {
    color: rgba(250,245,236,0.88);
    font-size: 1.2rem;
    margin-bottom: 40px;
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* === Section Labels === */
.section-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-sage-dark);
    margin-bottom: 10px;
}
.section-label-light { color: rgba(250,245,236,0.65); }
.divider {
    width: 56px;
    height: 4px;
    background: var(--color-tan);
    border-radius: 2px;
    margin: 16px auto 0;
}

/* === About Section === */
.about-section { text-align: center; }
.about-section h2 { margin-bottom: 8px; }
.about-section p {
    max-width: 680px;
    margin: 0 auto 16px;
    font-size: 1.1rem;
    color: var(--color-muted);
}
.about-section p:first-of-type { color: var(--color-text); font-size: 1.15rem; }

/* === Photo Grid === */
.photo-section h2 { text-align: center; margin-bottom: 8px; }
.photo-section .section-label { display: block; text-align: center; }
.photo-section .divider { margin-bottom: 40px; }
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.photo-grid img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(44,24,16,0.12);
}
.photo-placeholder {
    aspect-ratio: 4/3;
    background: var(--color-surface-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-size: 0.9rem;
    gap: 8px;
    padding: 16px;
    text-align: center;
}
.photo-placeholder .icon { font-size: 2rem; opacity: 0.5; }

/* === Events === */
.events-section { text-align: center; }
.events-section h2 { margin-bottom: 8px; }
.events-section .divider { margin-bottom: 40px; }
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}
.event-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-sage);
    border-radius: var(--radius);
    padding: 26px 24px;
    text-align: left;
    transition: box-shadow 0.2s;
}
.event-card:hover { box-shadow: 0 4px 20px rgba(44,24,16,0.1); }
.event-date {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-sage-dark);
    margin-bottom: 8px;
}
.event-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.event-card p { font-size: 0.95rem; color: var(--color-muted); }

/* === Page Hero (interior pages) === */
.page-hero {
    background: linear-gradient(160deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    padding: 64px 28px;
    text-align: center;
}
.page-hero h1 { color: var(--color-bg); }
.page-hero p {
    color: rgba(250,245,236,0.82);
    margin-top: 14px;
    font-size: 1.15rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === Building Hero === */
.building-hero {
    position: relative;
    height: 400px;
    background-color: var(--color-primary-dark);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.building-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(44,24,16,0.15) 0%, rgba(44,24,16,0.78) 100%);
    z-index: 1;
}
.building-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 32px;
}
.building-hero-content h1 {
    color: var(--color-bg);
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* === Breadcrumb === */
.breadcrumb {
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    padding: 13px 28px;
}
.breadcrumb a {
    font-size: 0.95rem;
    color: var(--color-muted);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--color-primary); }

/* === Building Content === */
.building-content {
    max-width: 940px;
    margin: 0 auto;
    padding: 60px 28px;
}
.building-history { margin-bottom: 60px; }
.building-history h2 { margin-bottom: 6px; }
.building-history .divider { margin: 12px 0 24px 0; }
.building-history p { font-size: 1.05rem; }

/* === Video Section === */
.building-videos h2 { margin-bottom: 8px; }
.building-videos .divider { margin: 12px 0 32px 0; }
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}
.video-card h3 { font-size: 1.1rem; margin-bottom: 14px; color: var(--color-muted); }
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 16px rgba(44,24,16,0.18);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
.video-placeholder {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface-alt);
    border: 2px dashed var(--color-border);
}
.video-placeholder-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    text-align: center;
    padding: 20px;
    gap: 10px;
}
.video-placeholder-inner .icon { font-size: 2.8rem; opacity: 0.5; }
.video-placeholder-inner span { font-size: 0.95rem; font-weight: 700; }

/* === Explore / Map Page === */
.map-intro { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.map-intro h2 { margin-bottom: 8px; }
.map-intro .divider { margin: 12px auto 20px; }
.map-intro p { color: var(--color-muted); }
.map-wrapper { display: flex; justify-content: center; }
.map-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.map-container img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    border-radius: var(--radius);
    box-shadow: 0 6px 28px rgba(44,24,16,0.22);
}
area { cursor: pointer; }

.map-tooltip {
    position: fixed;
    display: none;
    background: var(--color-primary);
    color: var(--color-bg);
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 300;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(44,24,16,0.32);
}

/* === Building Directory === */
.directory-section { padding: 56px 0; }
.directory-section h2 { text-align: center; margin-bottom: 8px; }
.directory-section .divider { margin-bottom: 36px; }
.building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}
.building-link {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.building-link:hover {
    background: var(--color-primary);
    color: var(--color-bg);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}
.building-link::before {
    content: '→';
    font-size: 1rem;
    flex-shrink: 0;
}

/* === Donations === */
.donations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    max-width: 1000px;
    margin: 0 auto;
}
.donation-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 40px 28px;
    text-align: center;
    box-shadow: 0 2px 14px rgba(44,24,16,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}
.donation-card:hover {
    box-shadow: 0 8px 28px rgba(44,24,16,0.16);
    transform: translateY(-4px);
}
.donation-card .card-icon { font-size: 3rem; margin-bottom: 18px; }
.donation-card h3 { margin-bottom: 12px; }
.donation-card p { color: var(--color-muted); margin-bottom: 28px; font-size: 0.95rem; line-height: 1.6; }
.donation-note {
    margin-top: 48px;
    padding: 24px 28px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-tan);
    border-radius: var(--radius);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
    color: var(--color-muted);
}
.donation-note strong { color: var(--color-text); }

/* === Contact === */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 64px;
    max-width: 1020px;
    margin: 0 auto;
}
.contact-info h2 { margin-bottom: 8px; }
.contact-info .divider { margin: 12px 0 28px 0; }
.contact-detail { margin-bottom: 24px; }
.contact-detail strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-sage-dark);
    margin-bottom: 4px;
}
.contact-detail p, .contact-detail a { font-size: 1rem; color: var(--color-muted); margin: 0; }
.contact-detail a:hover { color: var(--color-primary); }

.contact-form h2 { margin-bottom: 8px; }
.contact-form .divider { margin: 12px 0 32px 0; }
.form-group { margin-bottom: 22px; }
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-sage);
    box-shadow: 0 0 0 3px rgba(143,175,128,0.2);
}
.form-group textarea { resize: vertical; min-height: 140px; }

/* === Footer === */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(250,245,236,0.8);
    padding: 52px 28px;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.footer-links a {
    color: rgba(250,245,236,0.8);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--color-tan); }
.site-footer p { font-size: 0.9rem; margin-bottom: 5px; }

/* === YouTube Facade (click-to-play) === */
.yt-facade {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 16px rgba(44,24,16,0.18);
}
.yt-facade img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
    display: block;
}
.yt-facade:hover img { opacity: 0.8; }
.yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,0.72);
    border: 3px solid rgba(255,255,255,0.9);
    color: #fff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px; /* optical center for play triangle */
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    pointer-events: none;
}
.yt-facade:hover .yt-play-btn {
    background: #c00;
    border-color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}
.yt-facade .yt-label {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
}
/* After click — the iframe fills the wrapper */
.yt-facade iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* === Mobile === */
@media (max-width: 860px) {
    h1 { font-size: 2.1rem; }
    h2 { font-size: 1.7rem; }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-primary);
        padding: 8px 0 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    }
    .nav-links.open { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a {
        display: block;
        padding: 14px 28px;
        border-bottom: 1px solid rgba(250,245,236,0.08);
    }
    .nav-toggle { display: block; }

    .hero-content h1 { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 100%; max-width: 300px; text-align: center; }

    .section { padding: 52px 0; }

    .building-hero { height: 280px; }
    .building-content { padding: 44px 20px; }
    .video-grid { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; gap: 40px; }
    .donations-grid { grid-template-columns: 1fr; max-width: 480px; }
    .building-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
}

@media (max-width: 520px) {
    .container { padding: 0 18px; }
    h1 { font-size: 1.9rem; }
    .building-grid { grid-template-columns: 1fr 1fr; }
}
