/*
Theme Name: Wedding
Theme URI: https://example.com/wedding
Description: Private wedding info page
Version: 1.0
Author: Wedding Admin
*/

/* ===== Base (mobile-first) ===== */
:root {
    --dark-red: #75162D;
    --dark-red-soft: #8a2740;
    --beige: #E6D6C6;
    --beige-light: #f3ece3;
    --ink: #2f3a45;
    --ink-soft: #5a6571;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fbf7f2;
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
    font-weight: 400;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

header {
    text-align: center;
    padding: 100px 16px 80px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.45)),
                url('img/header-bg.jpg') center/cover no-repeat;
    border-bottom: none;
    position: relative;
}

header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.8em;
    font-weight: 600;
    margin: 0 0 6px;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

header .script {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4em;
    color: #fff;
    display: block;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Mobile-only: push script to top, h1+date to bottom to avoid faces */
@media (max-width: 599px) {
    header {
        padding: 40px 16px 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        min-height: 340px;
    }

    header .script {
        margin-bottom: auto;
    }
}

.section {
    padding: 36px 0;
    border-bottom: 1px solid var(--beige);
}

.section h2 {
    font-size: 2em;
    color: var(--ink);
    margin: 0 0 16px;
    line-height: 1.15;
}

.section h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 3px;
    background: var(--dark-red);
    margin-top: 12px;
    border-radius: 2px;
}

.section.center { text-align: center; }
.section.center h2::after { margin-left: auto; margin-right: auto; }

/* Highlighted (dark red) section */
.section-highlight {
    background: var(--dark-red);
    color: #fff;
    text-align: center;
    padding: 44px 24px;
    border: 0;
    border-radius: 12px;
    margin: 36px 0;
}

.section-highlight h2 { color: #fff; }
.section-highlight h2::after {
    background: rgba(255,255,255,0.7);
    margin-left: auto;
    margin-right: auto;
}
.section-highlight p { color: rgba(255,255,255,0.95); }

.section p {
    line-height: 1.7;
    font-size: 1.05em;
}

/* Event block (Obrad / Hostina) */
.event-block {
    text-align: center;
}
.event-block .event-time {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--dark-red);
    margin: 8px 0 4px;
}
.event-block .event-place {
    font-size: 1.05em;
    color: var(--ink-soft);
    margin: 0 0 16px;
}
.event-block .event-map-preview {
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--beige);
}
.event-block .event-map-preview iframe {
    width: 100%;
    height: 200px;
    border: 0;
    display: block;
}
.event-block .event-map {
    display: inline-block;
    margin-top: 8px;
    color: var(--dark-red);
    text-decoration: none;
    font-weight: 600;
}
.event-block .event-calendar {
    display: inline-block;
    margin-top: 12px;
    margin-left: 16px;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

/* Info cards */
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
}

.info-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(117,22,45,0.06);
    border: 1px solid var(--beige);
}

.info-card h3 {
    color: var(--dark-red);
    margin: 0 0 8px 0;
    font-size: 1.3em;
}

.info-card p {
    margin: 0;
}

footer {
    text-align: center;
    padding: 28px 16px;
    background-color: var(--beige-light);
    font-size: 0.9em;
    color: var(--ink-soft);
}

/* ===== Form styles ===== */
.wedding-form {
    max-width: 600px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group > label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--dark-red);
    font-size: 1em;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #d4c8bc;
    border-radius: 8px;
    font-size: 16px; /* prevents iOS zoom on focus */
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.form-group textarea {
    resize: vertical;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group label,
.checkbox-group label {
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e8e0d8;
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s;
}

.radio-group label:active,
.checkbox-group label:active {
    background: var(--beige-light);
    border-color: var(--dark-red);
}

.radio-group input,
.checkbox-group input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--dark-red);
}

/* Buttons */
.btn-submit {
    background-color: var(--dark-red);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
    width: 100%;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-submit:active {
    background-color: #5a1023;
}

/* ===== Admin responses table ===== */
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    min-width: 600px;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e8e0d8;
    vertical-align: top;
}

.admin-table thead th {
    background-color: var(--beige-light);
    color: var(--dark-red);
    font-weight: bold;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.admin-table tbody tr:hover {
    background-color: #fdf8f4;
}

.btn-delete {
    background: none;
    border: 1px solid #c0392b;
    color: #c0392b;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-delete:active {
    background-color: #c0392b;
    color: #fff;
}

/* ===== Admin photo gallery ===== */
.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.admin-photo-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-photo-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e8e0d8;
}

.admin-photo-meta {
    font-size: 0.75em;
    color: #888;
    text-align: center;
}

.admin-photo-item .btn-delete {
    width: 100%;
    padding: 6px 4px;
    font-size: 0.8em;
}

details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .toggle-hint { transition: transform .2s; display: inline-block; }
details.section[open] > summary .toggle-hint { transform: rotate(180deg); }

/* ===== Photo gallery ===== */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 16px;
}

.photo-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item:active img {
    opacity: 0.8;
}

/* File input */
.file-input {
    display: block;
    padding: 16px;
    border: 2px dashed #d4c8bc;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    background: #fff;
    font-size: 16px; /* prevents iOS zoom */
}

.form-hint {
    font-size: 0.85em;
    color: #7a6a5a;
    margin-top: 6px;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.95em;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-error p {
    margin: 4px 0;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
}

.lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5em;
    cursor: pointer;
    line-height: 1;
    padding: 10px;
    touch-action: manipulation;
    z-index: 10;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    border: none;
    color: #fff;
    font-size: 2.2em;
    line-height: 1;
    width: 52px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    touch-action: manipulation;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:active {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.lightbox-download {
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    touch-action: manipulation;
}

.lightbox-download:active {
    background: rgba(255,255,255,0.3);
}

/* Mobile: show hint, hide download link */
.lightbox-hint-mobile {
    color: rgba(255,255,255,0.75);
    font-size: 0.9em;
    margin: 0;
    text-align: center;
}

.lightbox-hint-desktop {
    display: none;
}

/* ===== Tablet & Desktop (600px+) ===== */
@media (min-width: 600px) {
    .container {
        padding: 24px;
    }

    header {
        padding: 100px 24px 80px;
    }

    header h1 {
        font-size: 2.5em;
    }

    header p {
        font-size: 1.2em;
    }

    .section {
        padding: 40px 0;
    }

    .section h2 {
        font-size: 1.8em;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .btn-submit {
        width: auto;
        padding: 15px 40px;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .photo-item {
        border-radius: 6px;
    }

    .lightbox-content {
        max-width: 90vw;
        max-height: 90vh;
        width: auto;
        height: auto;
        padding: 0;
    }

    .lightbox-img {
        max-width: 90vw;
        max-height: 80vh;
    }

    .lightbox-close {
        top: -40px;
        right: 0;
    }

    .radio-group label,
    .checkbox-group label {
        padding: 8px 12px;
    }

    /* Desktop: hide hint, show download link */
    .lightbox-hint-mobile {
        display: none;
    }

    .lightbox-hint-desktop {
        display: inline-block;
    }
}
