/* ================================================================
   PixyFoto Wetzlar – Photography Portfolio Styles
   ================================================================ */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: oklch(0.52 0.035 145);
    background: oklch(0.95 0.005 140);
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ===== CSS Custom Properties ===== */
:root {
    --color-primary: oklch(0.52 0.035 145);
    --color-sage: oklch(0.75 0.025 140);
    --color-stone: oklch(0.82 0.01 180);
    --color-honey: oklch(0.78 0.08 90);
    --color-bg: oklch(0.95 0.005 140);
    --color-text-light: oklch(0.98 0 0);
    --color-btn-text: oklch(0.25 0.04 145);

    --font-heading: 'Crimson Pro', Georgia, serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --accent-hue: 140;
    --accent-chroma: 0.005;

    --transition-reveal: 520ms;
    --transition-color: 420ms;
    --transition-card: 260ms;
    --transition-button: 160ms;
}

/* ===== Typography ===== */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Site Wrapper ===== */
.site-wrapper {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        135deg,
        oklch(0.95 0.005 140),
        oklch(0.93 var(--accent-chroma) var(--accent-hue))
    );
    transition: background var(--transition-color) ease;
    outline: none;
    position: relative;
}

/* Accent color classes for background gradient shift */
.site-wrapper.accent-tier {
    --accent-hue: 160;
    --accent-chroma: 0.035;
}

.site-wrapper.accent-event {
    --accent-hue: 50;
    --accent-chroma: 0.035;
}

.site-wrapper.accent-foto {
    --accent-hue: 280;
    --accent-chroma: 0.03;
}

.site-wrapper.accent-aboutme {
    --accent-hue: 30;
    --accent-chroma: 0.03;
}

/* ===== Site Content ===== */
.site-content {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== Landing Section ===== */
.landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3vw, 44px);
    transition: transform var(--transition-reveal) ease, opacity var(--transition-reveal) ease;
    will-change: transform, opacity;
}

.landing--hidden {
    position: absolute;
    inset: 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* ===== Site Header ===== */
.site-header {
    text-align: center;
    margin-bottom: clamp(24px, 4vw, 48px);
}

.site-title {
    font-weight: 700;
    font-size: clamp(42px, 5vw, 72px);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.site-title-accent {
    display: block;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 0.45em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-sage);
    margin-top: 6px;
}

.site-subtitle {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.5vw, 18px);
    color: var(--color-sage);
    margin-top: 10px;
    font-weight: 400;
}

/* ===== Gallery Grid ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: 960px;
    width: 100%;
    transition: gap var(--transition-card) ease;
}

@media (min-width: 781px) {
    .gallery.gallery--hovering {
        gap: 6px;
    }
}

/* ===== Gallery Card ===== */
.gallery-card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition:
        transform var(--transition-card) ease,
        filter var(--transition-card) ease,
        box-shadow var(--transition-card) ease;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-card:focus-visible {
    outline: 3px solid var(--color-honey);
    outline-offset: 4px;
}

.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.12) 45%,
        transparent 100%
    );
    transition: opacity var(--transition-card) ease;
    pointer-events: none;
}

.gallery-card__label {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: clamp(20px, 2.5vw, 28px);
    letter-spacing: 0.01em;
    color: var(--color-text-light);
    z-index: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Card hover states – desktop only */
@media (min-width: 781px) {
    .gallery-card--active {
        transform: scale(1.06) translateY(-6px);
        filter: brightness(1.05);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
        z-index: 2;
    }

    .gallery-card--active .gallery-card__overlay {
        opacity: 0.85;
    }

    .gallery-card--dimmed {
        filter: brightness(0.7);
        transform: scale(0.97);
    }

    /* Overlap translations toward active card */
    .gallery--hovering .gallery-card:nth-child(1).gallery-card--dimmed {
        transform: scale(0.97) translateX(14px);
    }

    .gallery--hovering .gallery-card:nth-child(3).gallery-card--dimmed {
        transform: scale(0.97) translateX(-14px);
    }
}

/* ===== Reveal Section ===== */
.reveal {
    flex: 1;
    padding: clamp(18px, 3vw, 44px);
    padding-top: clamp(24px, 4vw, 60px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease 120ms;
    outline: none;
}

.reveal--visible {
    opacity: 1;
    pointer-events: auto;
}

.reveal:not(.reveal--visible) {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.reveal-inner {
    max-width: 900px;
    margin: 0 auto;
}

.reveal-title {
    font-weight: 600;
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.reveal-subtitle {
    font-family: var(--font-body);
    font-size: clamp(16px, 2vw, 20px);
    color: var(--color-sage);
    font-weight: 600;
    margin-bottom: 18px;
}

.reveal-description {
    font-size: 16px;
    line-height: 1.65;
    max-width: 640px;
    margin-bottom: 36px;
    color: var(--color-primary);
}

/* ===== Back Button ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-primary);
    cursor: pointer;
    padding: 8px 16px 8px 12px;
    border-radius: 8px;
    margin-bottom: 24px;
    transition: background var(--transition-button) ease, transform var(--transition-button) ease;
}

.back-btn:hover {
    background: oklch(0.92 0.01 140);
    transform: translateY(-1px);
}

.back-btn:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

.back-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== About Me ===== */
.aboutme-card {
    position: relative;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 16 / 5;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-size: 100% 100%;
    background-position: center;
    margin-top: 18px;
    transition:
        transform var(--transition-card) ease,
        filter var(--transition-card) ease,
        box-shadow var(--transition-card) ease;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
}

.aboutme-card:hover {
    transform: scale(1.02) translateY(-4px);
    filter: brightness(1.05);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.aboutme-card:focus-visible {
    outline: 3px solid var(--color-honey);
    outline-offset: 4px;
}

.aboutme {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.aboutme-portrait {
    width: clamp(160px, 20vw, 220px);
    height: clamp(160px, 20vw, 220px);
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid oklch(0.90 0.01 140);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.aboutme-title {
    font-weight: 600;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: -0.02em;
    text-align: center;
    margin-top: 6px;
}

.aboutme-text {
    text-align: center;
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-primary);
    max-width: 560px;
}

.aboutme-album {
    width: 100%;
    margin-top: 12px;
}

/* ===== Albums ===== */
.albums {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.album-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.album-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    padding: 0;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-card) ease, box-shadow var(--transition-card) ease;
    outline: none;
}

.album-thumb:hover {
    transform: scale(1.04) translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.album-thumb:focus-visible {
    outline: 3px solid var(--color-honey);
    outline-offset: 2px;
}

.album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-empty {
    color: var(--color-sage);
    font-style: italic;
    font-size: 14px;
}

/* ===== Footer ===== */
.site-footer {
    padding: 18px clamp(18px, 3vw, 44px);
    border-top: 1px solid oklch(0.88 0.01 140);
    background: oklch(0.93 0.005 140 / 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--color-primary);
}

.footer-copy {
    font-size: 12px;
    color: var(--color-sage);
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-link {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background var(--transition-button) ease;
}

.footer-link:hover {
    background: oklch(0.90 0.01 140);
}

.footer-link:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

.footer-social {
    display: flex;
    justify-content: flex-end;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--color-primary);
    transition: background var(--transition-button) ease, transform var(--transition-button) ease;
}

.social-link:hover {
    background: oklch(0.90 0.01 140);
    transform: translateY(-1px);
    text-decoration: none;
}

.social-link:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* ===== Dialog / Modal ===== */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 18px;
    animation: fadeIn 200ms ease;
}

.dialog-panel {
    background: var(--color-bg);
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 85dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    animation: dialogSlideUp 300ms ease;
}

.dialog-close {
    position: sticky;
    top: 0;
    float: right;
    margin: 16px 16px 0 0;
    background: oklch(0.92 0.01 140);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: background var(--transition-button) ease;
    z-index: 1;
}

.dialog-close:hover {
    background: oklch(0.86 0.02 140);
}

.dialog-close:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

.dialog-body {
    padding: 12px 32px 32px;
}

.dialog-body h2 {
    font-weight: 600;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.dialog-body p {
    margin-bottom: 12px;
}

.dialog-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
}

/* ===== Contact Form ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    color: var(--color-primary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid oklch(0.82 0.01 140);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-primary);
    background: oklch(0.97 0.003 140);
    transition: border-color 200ms ease, box-shadow 200ms ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--color-honey);
    box-shadow: 0 0 0 3px oklch(0.78 0.08 90 / 0.2);
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
    cursor: pointer;
}

.form-check label {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-primary);
    cursor: pointer;
}

.form-error {
    color: oklch(0.55 0.2 25);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    background: var(--color-honey);
    color: var(--color-btn-text);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform var(--transition-button) ease, box-shadow var(--transition-button) ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px oklch(0.78 0.08 90 / 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.form-success {
    text-align: center;
    padding: 24px 0;
}

.form-success p {
    font-size: 16px;
    color: var(--color-primary);
}

/* ===== Image Viewer ===== */
.viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
    animation: fadeIn 200ms ease;
    outline: none;
}

.viewer-image {
    max-width: 90vw;
    max-height: 85dvh;
    border-radius: 8px;
    object-fit: contain;
    animation: viewerZoomIn 300ms ease;
}

.viewer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-button) ease;
}

.viewer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.viewer-close:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

/* Viewer navigation buttons */
.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-button) ease, transform var(--transition-button) ease;
    z-index: 1;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.viewer-nav:focus-visible {
    outline: 2px solid var(--color-honey);
    outline-offset: 2px;
}

.viewer-nav--prev {
    left: 18px;
}

.viewer-nav--next {
    right: 18px;
}

.viewer-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ===== Toast Notification ===== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 300;
    animation: toastSlideUp 350ms ease;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dialogSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes viewerZoomIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== Responsive – Mobile ===== */
@media (max-width: 780px) {
    .gallery {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .gallery-card {
        aspect-ratio: 1 / 1;
        background-position: top center;
    }

    .aboutme-card {
        aspect-ratio: 16 / 9;
    }

    .landing {
        justify-content: flex-start;
        padding-top: clamp(40px, 8vw, 80px);
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 12px;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-social {
        justify-content: center;
    }

    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dialog-body {
        padding: 12px 20px 24px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Error UI ===== */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
