/**
 * Pavlišová Art Portfolio - Custom Styles
 * Inspired by elegant, minimal aesthetic
 * Mobile-first responsive design
 */

/* ==========================================================================
   CSS Variables - Dark theme with warm gold accents
   ========================================================================== */
:root {
    --primary-color: #C9B97E;        /* Warm gold — slightly brightened for dark bg */
    --secondary-color: #A89870;      /* Mid taupe — muted/dimmed elements */
    --dark-color: #F0EAD8;           /* Warm cream — headings & strong text */
    --light-color: #18160F;          /* Very dark warm black — page background */
    --surface-color: #22201A;        /* Dark warm brown — cards, navbar, modal */
    --text-color: #C8BFA8;           /* Warm light grey — body text */
    --border-color: #3A3528;         /* Subtle dark border */
    --transition: all 0.7s ease;     /* Smooth elegant transitions */
    --border-radius: 0;              /* Sharp, clean edges */
}

/* ==========================================================================
   Global Styles
   ========================================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--light-color);
    color-scheme: dark;
}

/* Zero out all Bootstrap rounding globally */
*, *::before, *::after {
    border-radius: 0 !important;
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Headings with elegant letter-spacing */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: 0.05em;
    color: var(--dark-color);
    font-weight: 400;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    padding: 1.5rem 0;
    background-color: var(--surface-color) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    color: var(--dark-color) !important;
    font-weight: 300;
}

.navbar-brand .text-primary {
    color: var(--primary-color) !important;
}

.navbar-toggler {
    border-color: var(--primary-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23C9B97E' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(201, 185, 126, 0.25);
}

.nav-link {
    font-weight: 400;
    transition: var(--transition);
    color: var(--text-color) !important;
    letter-spacing: 0.03em;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 0;
    background-color: var(--surface-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    color: var(--text-color);
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: rgba(201, 185, 126, 0.1);
    color: var(--primary-color);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.language-switcher .lang-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 400;
    transition: var(--transition);
    letter-spacing: 0.05em;
}

.language-switcher .lang-link:hover,
.language-switcher .lang-link.active {
    color: var(--primary-color);
}

@media (min-width: 992px) {
    .language-switcher {
        border-left: 1px solid var(--border-color);
        padding-left: 1rem;
        margin-left: 1rem;
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding: 5rem 0;
    background-color: var(--surface-color);
}

.hero h1 {
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.hero .lead {
    color: var(--text-color);
    opacity: 0.9;
}

.hero-image-placeholder {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2720 0%, #1e1c16 100%);
    border: 1px solid var(--border-color);
}

@media (max-width: 991px) {
    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* ==========================================================================
   Cards - Elegant Outline Style
   ========================================================================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background-color: var(--surface-color);
    color: var(--text-color);
    box-shadow: none;
}


.artist-card {
    overflow: visible;
}

.artist-card .card-body {
    display: flex;
    flex-direction: column;
}

.artist-bio {
    flex-grow: 1;
}

/* ==========================================================================
   Buttons - Outline Style with Inset Effect
   ========================================================================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 400;
    transition: var(--transition);
    letter-spacing: 0.05em;
    padding: 0.6rem 1.5rem;
}

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

.btn-primary:active,
.btn-primary:focus-visible {
    background-color: transparent !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: none;
}

.btn-outline-primary {
    border: 1px solid var(--border-color);
    color: var(--dark-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-light {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--dark-color);
}

.btn-light:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 0.85rem 2rem;
    letter-spacing: 0.08em;
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

/* ==========================================================================
   Gallery
   ========================================================================== */
.artwork-card {
    cursor: pointer;
    border: 1px solid rgba(201,185,126,0.25);
    border-radius: 0 !important;
    transition: none;
}

.artwork-card .card-img-top {
    border-radius: 0 !important;
}

.artwork-card:hover {
    border-color: var(--primary-color);
}

/* Category placeholder when no featured artwork is set */
.category-no-image {
    background: var(--surface-color);
}

/* Card-body text stays readable when card is wrapped in <a> */
a .artwork-card .card-body {
    color: inherit;
}

.artwork-thumbnail {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.artwork-thumbnail img {
    transition: var(--transition);
    cursor: pointer;
    /* auto-size to intrinsic aspect ratio; max including padding fits in container */
    max-width: calc(100% - 1.3rem);
    max-height: calc(100% - 1.3rem);
    width: auto;
    height: auto;
    padding: 0.65rem;
    background: white;
}


.icon-large {
    font-size: 2rem;
}

.icon-xlarge {
    font-size: 3rem;
}

.empty-state-icon {
    font-size: 4rem;
}

/* ==========================================================================
   Filter Panel
   ========================================================================== */
#filterPanel {
    transition: var(--transition);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.form-check {
    padding-left: 1.75rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(190, 172, 116, 0.25);
}

/* ==========================================================================
   Biography Section
   ========================================================================== */
.bio-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.bio-content p:last-child {
    margin-bottom: 0;
}

/* Artist portrait on bio page — mobile-first, scales up */
.artist-profile-photo {
    display: block;
    width: 150px;
    height: 188px;           /* 4:5 portrait ratio */
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
    border: 3px solid var(--primary-color);
    box-shadow: 0 6px 24px rgba(95, 86, 58, 0.18);
    margin: 0 auto;
}

@media (min-width: 576px) {
    .artist-profile-photo {
        width: 180px;
        height: 225px;
    }
}

@media (min-width: 768px) {
    .artist-profile-photo {
        width: 210px;
        height: 263px;
        margin: 0;           /* remove auto-center once beside text */
    }
}

@media (min-width: 992px) {
    .artist-profile-photo {
        width: 250px;
        height: 313px;
    }
}

/* Artist photo on home-page card — portrait-aware crop */
.artist-card-photo {
    width: 100%;
    height: 450px;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 0;
}

@media (min-width: 768px) {
    .artist-card-photo {
        height: 800px;
    }
}

@media (min-width: 992px) {
    .artist-card-photo {
        height: 540px;
    }
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary-color);
    transform: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    margin-top: auto;
    background-color: #0F0E0A !important;
    border-top: 1px solid var(--border-color);
}

.footer a {
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-color) !important;
}

.footer .text-primary {
    color: var(--primary-color) !important;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    background-color: #2e2b22;
    color: var(--text-color);
}

.form-control::placeholder { color: var(--secondary-color); }

.form-select option {
    background-color: #2e2b22;
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(190, 172, 116, 0.15);
}

.form-label {
    color: var(--text-color);
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    border-radius: var(--border-radius);
    border: 1px solid;
}

.alert-success {
    background-color: rgba(201, 185, 126, 0.12);
    border-color: var(--primary-color);
    color: var(--dark-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.12);
    border-color: #dc3545;
    color: #f5a0a8;
}

.alert-info {
    background-color: rgba(201, 185, 126, 0.07);
    border-color: var(--secondary-color);
    color: var(--text-color);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */
.cta-section {
    background-color: var(--secondary-color) !important;
}

.bg-primary {
    background-color: var(--secondary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-light {
    background-color: var(--surface-color) !important;
}

.bg-white {
    background-color: var(--surface-color) !important;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.shadow {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted {
    color: var(--secondary-color) !important;
}

.text-dark {
    color: var(--dark-color) !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-color: var(--primary-color);
    border-right-color: transparent;
}

/* ==========================================================================
   Responsive Images
   ========================================================================== */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy loading images */
img.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    color: var(--text-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.btn-close {
    filter: invert(1) brightness(0.7);
}

/* Viewport-constrained modal */
.modal-dialog.modal-xl {
    max-width: 95vw;
    max-height: 95vh;
    margin: 2.5vh auto;
}

.modal-dialog.modal-xl .modal-content {
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-xl .modal-body {
    overflow: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Prevent scroll chaining out of modal (modern browsers + Android) */
#artworkModal {
    overscroll-behavior: contain;
}

/* Modal image container with zoom support */
.modal-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: transparent;
    min-height: 400px;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: crosshair;
    box-sizing: border-box;
    padding: 0.8rem;
    background: white;
}

/* Zoom lens - repositioned to artwork details area */
.zoom-lens {
    position: fixed;
    border: 3px solid var(--primary-color);
    width: 200px;
    height: 200px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(24, 22, 15, 0.97);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    border-radius: 0;
    overflow: hidden;
}

.zoom-lens.active {
    opacity: 1;
}

.zoom-lens::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-color);
    opacity: 0.3;
}

.zoom-lens::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--primary-color);
    opacity: 0.3;
}

/* Zoomed image preview - now inside the lens */
.zoom-result {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
}

.zoom-result.active {
    display: block;
}

.zoom-result img {
    position: absolute;
    max-width: none;
    max-height: none;
}

/* Adjust zoom on medium screens */
@media (max-width: 1200px) {
    .zoom-lens {
        width: 180px;
        height: 180px;
    }
}

/* Hide zoom on mobile/tablet */
@media (max-width: 991px) {
    .zoom-lens,
    .zoom-result {
        display: none !important;
    }

    .modal-image-container img {
        cursor: default;
        max-height: calc(50vh - 2rem);
    }

    .modal-dialog.modal-xl .modal-body {
        overflow-y: auto;
    }

    .modal-dialog.modal-xl {
        max-width: 98vw;
        max-height: 98vh;
        margin: 1vh auto;
    }

    .modal-image-container {
        min-height: auto;
        margin-bottom: 1rem;
    }
}


/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .navbar,
    .footer,
    .btn,
    #filterPanel {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .card {
        break-inside: avoid;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Additional Elegant Touches
   ========================================================================== */
.display-1, .display-2, .display-3, .display-4, .display-5 {
    font-weight: 300;
    letter-spacing: 0.05em;
}

.lead {
    font-weight: 300;
    letter-spacing: 0.02em;
}

a {
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

.bg-secondary {
    background-color: rgba(201, 185, 126, 0.07) !important;
}

/* Badge overrides for readability */
.badge.bg-secondary {
    background-color: var(--secondary-color) !important;
    color: #fff !important;
}

/* Placeholder styling */
.hero-image-placeholder i,
.empty-state-icon {
    color: var(--secondary-color);
    opacity: 0.3;
}

/* ==========================================================================
   News Section
   ========================================================================== */
.news-section { background-color: var(--surface-color); }

.news-card { border-radius: 0 !important; overflow: hidden; }

.news-card-img-wrap {
    position: relative;
    overflow: hidden;
}
.news-card-img-wrap::before {
    content: '';
    display: block;
    padding-top: 100%; /* 1:1 square */
}
.news-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (max-width: 767px) {
    .news-card-img-wrap::before { padding-top: 56.25%; /* 16:9 on mobile */ }
}

.news-card .card-body { padding-top: 0.9rem !important; }
@media (min-width: 992px) {
    .news-card .card-body { padding-top: 1.8rem !important; }
}

.news-card-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
}
.news-card-img-placeholder svg { width: 48%; height: 48%; }

.news-body p:last-child { margin-bottom: 0; }
.news-body ul,
.news-body ol { padding-left: 1.25rem; }

/* HP carousel only: card height defined by the image, not the text.
   Take the text column out of flex flow so the row height = image column height. */
@media (min-width: 768px) {
    .news-section .news-card .row.g-0 {
        position: relative;
    }
    .news-section .news-card .col-md-9 {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 75%;
        overflow: hidden;
    }
}

/* HP carousel only: clamp text to respect the 1:1 image square */
.news-section .news-body h1,
.news-section .news-body h2,
.news-section .news-body h3,
.news-section .news-body h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }

.news-section .news-body {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-section .news-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
    border: none;
    background-color: var(--text-color);
    opacity: 0.3;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.news-dot.active,
.news-dot:hover { opacity: 1; background-color: var(--primary-color); }

/* News list page */
.news-list-section { background-color: var(--light-color); min-height: 60vh; }

/* Offset sticky navbar when landing on anchor links */
.news-card[id] { scroll-margin-top: calc(5rem + 20px); } /* mobile */
@media (min-width: 768px) {
    .news-card[id] { scroll-margin-top: calc(5rem + 60px); } /* desktop: ~140px, lands higher */
}

/* Clickable title on HP carousel */
.news-card-title-link { color: inherit; text-decoration: none; }
.news-card-title-link:hover { color: var(--primary-color); }
