/* =====================================================
   ALBUM MATRIMONIO - Tema Dorato Moderno
   Responsive per iOS & Android
   ===================================================== */

:root {
    --gold: #D4AF37;
    --gold-light: #F5E6C8;
    --gold-dark: #B8860B;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --text: #f5f5f5;
    --text-muted: #a0a0a0;
    --border: rgba(212, 175, 55, 0.25);
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(15,15,15,0.97) 0%, rgba(15,15,15,0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.logo span {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 3.5rem 1.5rem 2.5rem;
    background: 
        radial-gradient(ellipse at 50% 0%, var(--gold-glow) 0%, transparent 60%),
        linear-gradient(180deg, #141414 0%, var(--bg-dark) 100%);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero .divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.25rem auto;
}

/* ===== GALLERY ===== */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: 600;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

.media-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    aspect-ratio: 1;
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.media-card:hover,
.media-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.media-card img,
.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-card .video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.media-card:hover .media-overlay,
.media-card:focus-within .media-overlay {
    opacity: 1;
}

.download-btn {
    background: var(--gold);
    color: #111;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.download-btn:hover {
    background: var(--gold-light);
    transform: scale(1.05);
}

.download-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: var(--shadow);
    object-fit: contain;
}

.lightbox-content video {
    width: min(100%, 900px);
    background: #000;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    color: var(--gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
}

.lightbox-close {
    top: 12px;
    right: 12px;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: var(--gold);
    color: #111;
}

.lightbox-nav.prev {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav.next {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

/* ===== ADMIN ===== */
.admin-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-card h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.admin-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #111;
    width: 100%;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gold);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

.btn-danger {
    background: #8b0000;
    color: #fff;
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-danger:hover {
    background: #a00;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(212, 175, 55, 0.03);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--gold);
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.upload-zone .hint {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Progress */
.upload-progress {
    display: none;
    margin-top: 1rem;
}

.progress-bar {
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    text-align: center;
}

/* Admin media list */
.admin-media-list {
    margin-top: 2rem;
}

.admin-media-list h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}

.admin-item img,
.admin-item .video-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #222;
    flex-shrink: 0;
}

.admin-item .info {
    flex: 1;
    min-width: 0;
}

.admin-item .info .name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-item .info .meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #6fdf8a;
}

.alert-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #f5a0a8;
}

.alert-info {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border);
    color: var(--gold-light);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--gold);
    text-decoration: none;
}

/* Touch improvements for mobile */
@media (max-width: 600px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-nav.prev { left: 4px; }
    .lightbox-nav.next { right: 4px; }
    
    .media-overlay {
        opacity: 1; /* sempre visibile su mobile per i download */
        background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 40%);
    }
    
    .download-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
