/* ============================================================
   HOME V2 — User-Facing Page Styles
   Layout-first CMS: sections rendered within layout grid rows
   Class names aligned with home-v2.js
   ============================================================ */

/* ==================== PAGE CONTAINER ==================== */
.home-v2-page {
    width: 100%;
    min-height: 100%;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

.hv2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 80px 20px;
    color: #1E6332;
    font-size: 1.1rem;
}

.hv2-loading i {
    font-size: 1.4rem;
    animation: progressSpin 1s linear infinite;
}

/* ==================== EDIT FAB (employee only) ==================== */
.hv2-edit-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(30, 99, 50, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hv2-edit-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(30, 99, 50, 0.45);
}

.hv2-edit-fab:active {
    transform: translateY(-1px);
}

/* ==================== LAYOUT ROW SYSTEM ==================== */
.hv2-row {
    display: flex;
    gap: 0;
}

.hv2-row--full {
    display: block;
}

.hv2-row--cols {
    display: grid;
    gap: 0;
}

.hv2-col {
    min-width: 0;
}

/* ==================== SECTION WRAPPER ==================== */
.hv2-section {
    padding: 32px 24px;
}

/* Section type modifiers (for targeted overrides) */
.hv2-section--image {
    padding: 16px 24px;
}

.hv2-section--hero {
    padding: 0;
}

.hv2-section--links {
    padding: 12px 24px;
}

/* ==================== SECTION TYPE: IMAGE (LOGO) ==================== */
.hv2-image {
    max-height: 80px;
    width: auto;
    object-fit: contain;
    display: block;
}

.hv2-image-link {
    display: inline-block;
    text-decoration: none;
}

.hv2-image-link:hover .hv2-image {
    opacity: 0.85;
}

/* ==================== SECTION TYPE: HERO ==================== */
.hv2-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 48px 32px;
}

.hv2-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hv2-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    width: 100%;
}

/* Alignment classes (set via JS class, not data attribute) */
.hv2-align-center {
    text-align: center;
}

.hv2-align-left {
    text-align: left;
}

.hv2-align-right {
    text-align: right;
}

.hv2-hero-headline {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin: 0 0 12px;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.hv2-hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin: 0 0 24px;
    line-height: 1.5;
}

.hv2-hero-cta {
    display: inline-block;
    background: #fff;
    color: #1E6332;
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hv2-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #1E6332;
    text-decoration: none;
}

/* ==================== SECTION TYPE: RICH TEXT ==================== */
.hv2-richtext {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

.hv2-richtext h1 {
    color: #1E6332;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.25;
}

.hv2-richtext h2 {
    color: #1E6332;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.hv2-richtext h3 {
    color: #1E6332;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.35;
}

.hv2-richtext p {
    color: #333;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 14px;
}

.hv2-richtext a {
    color: #1E6332;
    text-decoration: none;
    transition: color 0.15s ease;
}

.hv2-richtext a:hover {
    color: #2F8542;
    text-decoration: underline;
}

.hv2-richtext img {
    max-width: 100%;
    border-radius: 10px;
    height: auto;
}

.hv2-richtext ul,
.hv2-richtext ol {
    padding-left: 24px;
    margin: 0 0 14px;
}

.hv2-richtext li {
    margin-bottom: 6px;
}

.hv2-richtext blockquote {
    border-left: 4px solid #1E6332;
    margin: 16px 0;
    padding: 12px 20px;
    background: #F4F0E9;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

/* ==================== SECTION TYPE: CARD ==================== */
.hv2-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

.hv2-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.hv2-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hv2-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin: 0 0 8px;
}

.hv2-card-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin: 0;
}

.hv2-card-link {
    display: inline-block;
    color: #1E6332;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    text-decoration: none;
    font-family: 'Futura PT', 'Jost', sans-serif;
    transition: color 0.15s ease;
}

.hv2-card-link:hover {
    color: #2F8542;
    text-decoration: underline;
}

/* ==================== SECTION TYPE: GALLERY ==================== */
.hv2-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

/* Column-count variants */
.hv2-gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.hv2-gallery--cols-3 { grid-template-columns: repeat(3, 1fr); }
.hv2-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }

.hv2-gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #e0e0e0;
}

.hv2-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hv2-gallery-item:hover img {
    transform: scale(1.05);
}

.hv2-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff;
    font-size: 13px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

/* ==================== LIGHTBOX ==================== */
.hv2-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hv2-lightbox-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.hv2-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10201;
}

.hv2-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hv2-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10201;
}

.hv2-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hv2-lightbox-prev {
    left: 20px;
}

.hv2-lightbox-next {
    right: 20px;
}

.hv2-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hv2-lightbox-img-wrap img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}

.hv2-lightbox-footer {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10201;
}

.hv2-lightbox-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin-bottom: 4px;
}

.hv2-lightbox-counter {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

/* ==================== ANNOUNCEMENT SECTION ==================== */
.hv2-announcements-strip {
    padding: 0 20px;
    margin-bottom: 16px;
}
.hv2-announcements-strip:not(:empty) {
    padding-top: 20px;
}
.hv2-banner-strip {
    display: none; /* banners integrated into announcements strip */
}

/* Section wrapper */
.hv2-ann-section {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8e4df;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* Header */
.hv2-ann-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%);
    gap: 10px;
}
.hv2-ann-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.hv2-ann-icon {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
}
.hv2-ann-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    font-family: 'Futura PT', 'Jost', sans-serif;
    letter-spacing: 0.3px;
}
.hv2-ann-unread-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.18);
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.hv2-ann-ack-badge {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251,191,36,0.12);
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.hv2-ann-view-all {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Futura PT', 'Jost', sans-serif;
}
.hv2-ann-view-all:hover {
    background: rgba(255,255,255,0.22);
}
.hv2-ann-view-all i {
    margin-left: 4px;
    font-size: 10px;
    transition: transform 0.2s;
}
.hv2-ann-view-all:hover i {
    transform: translateX(3px);
}

/* Cards container */
.hv2-ann-cards {
    display: flex;
    flex-direction: column;
}

/* Individual card */
.hv2-ann-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f2f0ed;
    position: relative;
}
.hv2-ann-card:last-child {
    border-bottom: none;
}
.hv2-ann-card:hover {
    background: #fafaf8;
}
.hv2-ann-card.hv2-ann-new {
    background: linear-gradient(90deg, color-mix(in srgb, var(--hv2-ann-color) 4%, #fff) 0%, #fff 60%);
}
.hv2-ann-card.hv2-ann-new:hover {
    background: linear-gradient(90deg, color-mix(in srgb, var(--hv2-ann-color) 7%, #fff) 0%, #fafaf8 60%);
}

/* Left accent bar for pinned/banner items */
.hv2-ann-card-accent {
    display: none;
}
.hv2-ann-card.hv2-ann-pinned .hv2-ann-card-accent {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--hv2-ann-color), color-mix(in srgb, var(--hv2-ann-color) 60%, #000));
    border-radius: 0;
}

/* Urgent pulse */
.hv2-ann-card.hv2-ann-urgent {
    animation: hv2AnnUrgent 3s ease-in-out infinite;
}
@keyframes hv2AnnUrgent {
    0%, 100% { background: #fff; }
    50% { background: #fef2f2; }
}

/* Category icon circle */
.hv2-ann-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

/* Body */
.hv2-ann-card-body {
    flex: 1;
    min-width: 0;
}
.hv2-ann-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.hv2-ann-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #231F20;
    font-family: 'Futura PT', 'Jost', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}
.hv2-ann-cat-chip {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.hv2-ann-cat-chip i {
    font-size: 9px;
}
.hv2-ann-pri {
    font-size: 12px;
    line-height: 1;
}
.hv2-ann-pri.urgent { color: #dc2626; }
.hv2-ann-pri.important { color: #d97706; }
.hv2-ann-pin {
    font-size: 10px;
    color: #C19A6B;
    transform: rotate(30deg);
}
.hv2-ann-card-preview {
    font-size: 12.5px;
    color: #6b7280;
    margin: 3px 0 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 480px;
}

/* Right meta */
.hv2-ann-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.hv2-ann-card-time {
    font-size: 11.5px;
    color: #9ca3af;
    white-space: nowrap;
}
.hv2-ann-card-ack {
    color: #d97706;
    font-size: 13px;
}
.hv2-ann-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1E6332;
    flex-shrink: 0;
    animation: hv2AnnDotPulse 2s ease-in-out infinite;
}
@keyframes hv2AnnDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.hv2-ann-card-chevron {
    font-size: 11px;
    color: #d1d5db;
    transition: all 0.2s;
}
.hv2-ann-card:hover .hv2-ann-card-chevron {
    color: var(--hv2-ann-color, #1E6332);
    transform: translateX(2px);
}

/* ==================== EMPTY STATE ==================== */
.hv2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.hv2-empty-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

.hv2-empty-icon i {
    font-size: inherit;
    color: inherit;
}

.hv2-empty-title {
    color: #666;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Futura PT', 'Jost', sans-serif;
    margin-bottom: 6px;
}

.hv2-empty-text {
    color: #999;
    font-size: 14px;
    font-family: 'Futura PT', 'Jost', sans-serif;
}

/* ==================== RESPONSIVE (MOBILE) ==================== */
@media (max-width: 768px) {
    .hv2-row--cols {
        display: flex;
        flex-direction: column;
    }

    .hv2-hero {
        min-height: 220px;
        padding: 24px 16px;
    }

    .hv2-hero-headline {
        font-size: 1.6rem;
    }

    .hv2-hero-subtitle {
        font-size: 0.95rem;
    }

    .hv2-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .hv2-gallery--cols-3,
    .hv2-gallery--cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hv2-section {
        padding: 20px 16px;
    }

    .hv2-edit-fab {
        bottom: 80px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .hv2-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .hv2-lightbox-prev {
        left: 10px;
    }

    .hv2-lightbox-next {
        right: 10px;
    }

    .hv2-card {
        padding: 20px;
    }

    .hv2-richtext {
        max-width: 100%;
    }

    .hv2-links-nav {
        justify-content: flex-start;
    }

    .hv2-card-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ==================== CANVAS LAYOUT (Free-form) ==================== */

.hv2-canvas {
    margin: 0 auto;
    max-width: 1400px;
}

.hv2-canvas-block {
    border-radius: 8px;
}

.hv2-canvas-block .hv2-section {
    width: 100%;
    height: 100%;
}

.hv2-canvas-block .hv2-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv2-canvas-block .hv2-hero {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hv2-canvas-block .hv2-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hv2-canvas-block .hv2-richtext {
    height: 100%;
    overflow: auto;
}

.hv2-canvas-block .hv2-gallery {
    height: 100%;
}

.hv2-canvas-block .hv2-gallery-grid {
    height: 100%;
    overflow: hidden;
}

/* ---- Mobile: stacked vertically ---- */
.hv2-canvas-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.hv2-canvas-mobile-block {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.hv2-canvas-mobile-block .hv2-section {
    width: 100%;
}
