/* =========================================================
   PLATFORMA — Naer Miljoe Template
   Warm, community-driven, local, human, modern
   ========================================================= */

/* ─── 1. TOKENS ─────────────────────────────────────────── */

:root {
    --nm-bg:            #F7F5F0;
    --nm-surface:       #FFFFFF;
    --nm-text:          #2D2A26;
    --nm-text-soft:     #5C574F;
    --nm-text-muted:    #8A857D;
    --nm-text-faint:    #AEA9A1;
    --nm-accent:        #3D6B5E;
    --nm-accent-light:  rgba(61, 107, 94, 0.08);
    --nm-accent-hover:  #2E5347;
    --nm-warm:          #C4704B;
    --nm-warm-light:    rgba(196, 112, 75, 0.08);
    --nm-border:        rgba(45, 42, 38, 0.08);
    --nm-border-mid:    rgba(45, 42, 38, 0.14);
    --nm-radius:        0.75rem;
    --nm-radius-lg:     1rem;
    --nm-shadow:        0 1px 3px rgba(45, 42, 38, 0.06);
    --nm-shadow-md:     0 4px 16px rgba(45, 42, 38, 0.08);
    --nm-container:     1060px;
    --nm-section-gap:   4.5rem;
    --nm-font:          system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ─── 2. PAGE SHELL ─────────────────────────────────────── */

.nm {
    background: var(--nm-bg);
    color: var(--nm-text);
    font-family: var(--nm-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nm-container {
    max-width: var(--nm-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.platforma-site-main:has(> .nm) {
    max-width: none;
    padding: 0;
}

/* ─── 3. PREVIEW BANNER ────────────────────────────────── */

.nm-preview-banner {
    background: var(--nm-accent);
    color: #fff;
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.nm-preview-banner-link {
    color: rgba(255, 255, 255, 0.75);
    margin-left: 1rem;
    text-decoration: underline;
}

.nm-preview-banner-link:hover { color: #fff; }

/* ─── 4. HERO (warm, community, light overlay) ─────────── */

.nm-hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--nm-accent);
}

.nm-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
}

.nm-hero-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    background: linear-gradient(
        to top,
        rgba(45, 42, 38, 0.65) 0%,
        rgba(45, 42, 38, 0.25) 50%,
        transparent 100%
    );
    padding: 3.5rem 0 3rem;
}

.nm-hero-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nm-hero-eyebrow {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.nm-hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin: 0;
    max-width: 580px;
}

.nm-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    max-width: 460px;
    margin: 0;
    font-weight: 400;
}

.nm-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

@media (max-width: 768px) {
    .nm-hero { min-height: 380px; }
    .nm-hero-overlay { padding: 2.5rem 0 2rem; }
    .nm-hero-title { font-size: 2rem; }
}

@media (max-width: 480px) {
    .nm-hero { min-height: 320px; }
    .nm-hero-title { font-size: 1.7rem; }
}

/* ─── 4b. SUB-PAGE HERO + CTA (Slice 4.9b) ──────────────
   Warm community variant: cream backdrop, serif headline, optional
   rounded photo beside the text on desktop. The CTA band sits as a
   soft-green card — "join us" rather than "act now". Rounded
   everything (--nm-radius 0.75rem) for the hand-made, human feel. */

.nm-hero--subpage {
    min-height: 0;
    padding: 4.5rem 0 3rem;
    background: var(--nm-bg);
    display: block;
}

.nm-hero-layout {
    max-width: var(--nm-container);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

.nm-hero-content--subpage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    align-items: flex-start;
}

.nm-hero-content--subpage .nm-hero-title {
    font-size: 2.75rem;
    line-height: 1.12;
    color: var(--nm-text);
    margin: 0;
    /* Heading font injected by Slice 4.8 via --chub-heading-font which
       maps to Merriweather for this template. */
    font-family: var(--chub-heading-font, 'Merriweather', Georgia, serif);
    font-weight: 700;
    letter-spacing: -0.015em;
}

.nm-hero-content--subpage .nm-hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--nm-warm);
    margin: 0;
}

.nm-hero-content--subpage .nm-hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--nm-text-soft);
    max-width: 540px;
    margin: 0;
}

/* Stabilize 5 — aspect-ratio på container, ikke kun child-img.
   Container-niveau er defensivt mod fremtidige ændringer af child-
   img-reglerne og mod at admin uploader billeder med uventet
   proportioner — layout bevares uanset. */
.nm-hero-figure {
    margin: 0;
    border-radius: var(--nm-radius-lg);
    overflow: hidden;
    box-shadow: var(--nm-shadow-md);
    aspect-ratio: 4 / 3;
    background: var(--nm-surface, #F5F2EB);
}

.nm-hero-figure img {
    width: 100%;
    height: 100%;
    display: block;
    /* Stabilize-D (2026-04-25): contain over cover så uploaded logo /
       portræt aldrig klippes. 4:3-figure-rammen udfyldes af container-
       baggrund (var(--nm-surface)) når aspect ikke matcher. */
    object-fit: contain;
    object-position: center;
}

.nm-cta-section {
    padding: 3.5rem 2rem 4.5rem;
    background: var(--nm-bg);
}

.nm-cta-card {
    max-width: var(--nm-container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 2.75rem 3rem;
    background: linear-gradient(135deg, var(--nm-accent-light), var(--nm-surface));
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-lg);
    box-shadow: var(--nm-shadow);
}

.nm-cta-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.nm-cta-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nm-warm);
    margin: 0;
}

.nm-cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nm-text);
    margin: 0;
    font-family: var(--chub-heading-font, 'Merriweather', Georgia, serif);
    line-height: 1.25;
}

.nm-cta-subtitle {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--nm-text-soft);
    margin: 0;
}

/* New button variants introduced with 4.9b — ghost (subtle secondary)
   and warm (terracotta — use on the CTA band as the brand moment). */

.nm-btn--ghost {
    background: transparent;
    color: var(--nm-accent);
    border: 1px solid var(--nm-border-mid);
}

.nm-btn--ghost:hover {
    background: var(--nm-accent-light);
    border-color: var(--nm-accent);
}

.nm-btn--warm {
    background: var(--nm-warm);
    color: #ffffff;
    border: 1px solid var(--nm-warm);
}

.nm-btn--warm:hover {
    background: #A85B3A;
    border-color: #A85B3A;
}

@media (min-width: 820px) {
    .nm-hero-layout {
        grid-template-columns: 1.15fr 1fr;
        gap: 3.5rem;
    }
    .nm-hero-figure {
        order: 2;
    }
}

@media (max-width: 768px) {
    .nm-hero--subpage { padding: 3rem 0 2.5rem; }
    .nm-hero-content--subpage .nm-hero-title { font-size: 2rem; }
    .nm-cta-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.75rem;
        gap: 1.25rem;
    }
}

/* ─── 5. SECTIONS (shared) ─────────────────────────────── */

.nm-section {
    padding: var(--nm-section-gap) 0;
}

.nm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nm-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nm-text);
    letter-spacing: -0.01em;
    margin: 0;
}

.nm-section-subtitle {
    font-size: 0.9rem;
    color: var(--nm-text-muted);
    margin: 0.25rem 0 0;
}

.nm-section-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--nm-accent);
    text-decoration: none;
    white-space: nowrap;
}

.nm-section-link:hover {
    text-decoration: underline;
}

/* ─── 6. EVENTS ────────────────────────────────────────── */

.nm-section--events {
    background: var(--nm-surface);
}

.nm-events {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.nm-event {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--nm-bg);
    border-radius: var(--nm-radius);
    border: 1px solid var(--nm-border);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.nm-event:hover {
    box-shadow: var(--nm-shadow-md);
}

.nm-event-accent {
    width: 3px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
    background: var(--nm-accent);
}

.nm-event-accent[data-category="social"]      { background: var(--nm-warm); }
.nm-event-accent[data-category="meeting"]     { background: var(--nm-accent); }
.nm-event-accent[data-category="maintenance"] { background: var(--nm-text-muted); }

.nm-event-date {
    display: flex;
    flex-direction: column;
    min-width: 5rem;
    flex-shrink: 0;
}

.nm-event-day {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--nm-text);
}

.nm-event-time {
    font-size: 0.78rem;
    color: var(--nm-text-muted);
    margin-top: 0.1rem;
}

.nm-event-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.nm-event-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--nm-text);
    margin: 0;
}

.nm-event-location {
    font-size: 0.82rem;
    color: var(--nm-text-muted);
}

.nm-event-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nm-event-spots {
    font-size: 0.75rem;
    color: var(--nm-text-faint);
    white-space: nowrap;
}

@media (max-width: 700px) {
    .nm-events { grid-template-columns: 1fr; }
}

/* ─── 7. NOTICES (magazine style) ──────────────────────── */

.nm-notices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.nm-notice {
    background: var(--nm-surface);
    border-radius: var(--nm-radius);
    border: 1px solid var(--nm-border);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.nm-notice:hover {
    box-shadow: var(--nm-shadow-md);
}

.nm-notice-content {
    padding: 1.5rem;
}

.nm-notice-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--nm-text-faint);
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.nm-notice-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--nm-text);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}

.nm-notice-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nm-notice-link:hover {
    color: var(--nm-accent);
}

.nm-notice-preview {
    font-size: 0.88rem;
    color: var(--nm-text-soft);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nm-notice-author {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--nm-accent);
}

/* ─── 8. FACILITIES (warm cards) ───────────────────────── */

.nm-facilities {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.nm-facility {
    background: var(--nm-surface);
    border-radius: var(--nm-radius);
    border: 1px solid var(--nm-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.nm-facility:hover {
    box-shadow: var(--nm-shadow-md);
}

.nm-facility-visual {
    height: 160px;
    background: linear-gradient(135deg, #E8E4DA, #D4CFC4);
    overflow: hidden;
}

.nm-facility-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.nm-facility:hover .nm-facility-visual img {
    transform: scale(1.03);
}

.nm-facility-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.25;
}

.nm-facility-placeholder[data-icon="house"]::before  { content: "\1F3E0"; }
.nm-facility-placeholder[data-icon="wash"]::before   { content: "\1F9FA"; }
.nm-facility-placeholder[data-icon="grill"]::before  { content: "\1F525"; }
.nm-facility-placeholder[data-icon="bed"]::before    { content: "\1F6CF"; }
.nm-facility-placeholder[data-icon="gym"]::before    { content: "\1F3CB"; }
.nm-facility-placeholder[data-icon="car"]::before    { content: "\1F697"; }

.nm-facility-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nm-facility-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--nm-text);
    margin: 0;
}

.nm-facility-desc {
    font-size: 0.85rem;
    color: var(--nm-text-soft);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

@media (max-width: 900px) {
    .nm-facilities { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .nm-facilities { grid-template-columns: 1fr; }
}

/* ─── 9. QUICK ACTIONS (community shortcuts) ───────────── */

.nm-section--actions {
    padding: 3rem 0;
}

.nm-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.nm-action {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem;
    background: var(--nm-surface);
    border-radius: var(--nm-radius);
    border: 1px solid var(--nm-border);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.nm-action:hover {
    box-shadow: var(--nm-shadow-md);
    border-color: var(--nm-accent-light);
}

.nm-action-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--nm-text);
}

.nm-action-desc {
    font-size: 0.82rem;
    color: var(--nm-text-muted);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .nm-actions { grid-template-columns: 1fr; }
}

/* ─── 10. CTA BAND ─────────────────────────────────────── */

.nm-section--cta {
    background: var(--nm-accent);
    padding: 4rem 0;
}

.nm-cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nm-cta-content {
    flex: 1;
}

.nm-cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 0.4rem;
}

.nm-cta-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .nm-cta-band { flex-direction: column; text-align: center; }
}

/* ─── 11. BUTTONS ───────────────────────────────────────── */

.nm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--nm-font);
    font-size: 0.88rem;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
    line-height: 1;
}

.nm-btn--primary {
    background: var(--nm-accent);
    color: #FFFFFF;
    border-color: var(--nm-accent);
}

.nm-btn--primary:hover {
    background: var(--nm-accent-hover);
    border-color: var(--nm-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 107, 94, 0.25);
}

.nm-section--cta .nm-btn--primary {
    background: #FFFFFF;
    color: var(--nm-accent);
    border-color: #FFFFFF;
}

.nm-section--cta .nm-btn--primary:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nm-btn--secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

.nm-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nm-btn--small {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
    background: var(--nm-accent-light);
    color: var(--nm-accent);
    border-color: transparent;
}

.nm-btn--small:hover {
    background: var(--nm-accent);
    color: #FFFFFF;
}

.nm-btn--lg {
    padding: 0.8rem 2rem;
    font-size: 0.95rem;
}

.nm-btn--disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ─── 12. EMPTY STATE ───────────────────────────────────── */

.nm-empty {
    text-align: center;
    color: var(--nm-text-faint);
    font-size: 0.95rem;
    padding: 4rem 0;
}

/* ─── 13. PRINT ─────────────────────────────────────────── */

@media print {
    .nm-preview-banner,
    .nm-section--actions,
    .nm-section--cta { display: none; }
    .nm-hero { min-height: auto; }
    .nm-section { padding: 1.5rem 0; }
}
