/**
 * Eesti Fotograafid - Main Stylesheet
 *
 * Color Palette:
 * --ef-primary:    #1a1a2e  (Deep navy)
 * --ef-accent:     #e07a5f  (Warm coral)
 * --ef-bg:         #fafafa  (Off-white)
 * --ef-surface:    #ffffff  (White)
 * --ef-text:       #2d2d2d  (Near black)
 * --ef-text-light: #6b7280  (Gray)
 * --ef-border:     #e5e7eb  (Light gray)
 * --ef-success:    #059669  (Green)
 * --ef-error:      #dc2626  (Red)
 *
 * Typography: Inter + Playfair Display
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    --ef-primary: #1a1a2e;
    --ef-accent: #e07a5f;
    --ef-accent-hover: #c96a50;
    --ef-bg: #fafafa;
    --ef-surface: #ffffff;
    --ef-text: #2d2d2d;
    --ef-text-light: #6b7280;
    --ef-border: #e5e7eb;
    --ef-success: #059669;
    --ef-error: #dc2626;
    --ef-radius: 8px;
    --ef-radius-lg: 12px;
    --ef-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --ef-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --ef-shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --ef-transition: 0.2s ease;
    --ef-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ef-font-display: 'Playfair Display', Georgia, serif;
}

/* ============================
 * Reset & Base
 * ============================ */
.ef-main {
    font-family: var(--ef-font-sans);
    color: var(--ef-text);
    background: var(--ef-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ef-main *,
.ef-main *::before,
.ef-main *::after {
    box-sizing: border-box;
}

.ef-main img {
    max-width: 100%;
    height: auto;
    display: block;
}

.ef-main a {
    text-decoration: none;
    color: inherit;
    transition: color var(--ef-transition);
}

/* ============================
 * Layout
 * ============================ */
.ef-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.ef-container--narrow {
    max-width: 720px;
}

/* ============================
 * Buttons
 * ============================ */
.ef-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--ef-radius);
    font-family: var(--ef-font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--ef-transition);
    line-height: 1.4;
}

.ef-btn--primary {
    background: var(--ef-accent);
    color: #fff;
}

.ef-btn--primary:hover {
    background: var(--ef-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--ef-shadow-md);
}

.ef-btn--outline {
    background: transparent;
    color: var(--ef-text);
    border: 1.5px solid var(--ef-border);
}

.ef-btn--outline:hover {
    border-color: var(--ef-accent);
    color: var(--ef-accent);
}

.ef-btn--ghost {
    background: transparent;
    color: var(--ef-text-light);
    padding: 12px 16px;
}

.ef-btn--ghost:hover {
    color: var(--ef-text);
}

.ef-btn--large {
    padding: 16px 32px;
    font-size: 1.0625rem;
}

/* ============================
 * Hero Section
 * ============================ */
.ef-hero {
    background: var(--ef-primary);
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
}

.ef-hero__title {
    font-family: var(--ef-font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 600;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.ef-hero__subtitle {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.75);
    margin: 0 auto 40px;
    max-width: 540px;
    font-weight: 300;
}

.ef-hero__search {
    max-width: 840px;
    margin: 0 auto;
}

.ef-hero__search-inner {
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--ef-radius-lg);
    padding: 8px;
    backdrop-filter: blur(10px);
}

.ef-hero__search-input,
.ef-hero__search-select {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: var(--ef-radius);
    font-family: var(--ef-font-sans);
    font-size: 0.9375rem;
    background: #fff;
    color: var(--ef-text);
    min-width: 0;
}

.ef-hero__search-input::placeholder {
    color: var(--ef-text-light);
}

.ef-hero__search .ef-btn {
    flex-shrink: 0;
    padding: 14px 28px;
}

/* ============================
 * Stats
 * ============================ */
.ef-stats {
    padding: 48px 0;
    background: var(--ef-surface);
    border-bottom: 1px solid var(--ef-border);
}

.ef-stats__grid {
    display: flex;
    justify-content: center;
    gap: 64px;
}

.ef-stats__item {
    text-align: center;
}

.ef-stats__number {
    display: block;
    font-family: var(--ef-font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ef-primary);
    line-height: 1.2;
}

.ef-stats__label {
    font-size: 0.875rem;
    color: var(--ef-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ============================
 * Sections
 * ============================ */
.ef-section {
    padding: 64px 0;
}

.ef-section--light {
    background: var(--ef-surface);
}

.ef-section__title {
    font-family: var(--ef-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 40px;
    color: var(--ef-primary);
}

.ef-section__cta {
    text-align: center;
    margin-top: 40px;
}

/* ============================
 * Category Cards
 * ============================ */
.ef-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ef-category-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius);
    transition: all var(--ef-transition);
}

.ef-category-card:hover {
    border-color: var(--ef-accent);
    box-shadow: var(--ef-shadow);
    transform: translateY(-2px);
}

.ef-category-card__name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ef-text);
}

.ef-category-card__count {
    font-size: 0.8125rem;
    color: var(--ef-text-light);
    margin-top: 4px;
}

/* ============================
 * Card Grid
 * ============================ */
.ef-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ============================
 * Photographer Card
 * ============================ */
.ef-card {
    background: var(--ef-surface);
    border-radius: var(--ef-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ef-border);
    transition: all var(--ef-transition);
}

.ef-card:hover {
    box-shadow: var(--ef-shadow-lg);
    transform: translateY(-3px);
}

.ef-card__link {
    display: block;
}

.ef-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
}

.ef-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ef-card:hover .ef-card__image img {
    transform: scale(1.04);
}

.ef-card__placeholder {
    opacity: 0.4;
    padding: 20%;
}

.ef-card__content {
    padding: 20px;
}

.ef-card__name {
    font-family: var(--ef-font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--ef-primary);
}

.ef-card__location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--ef-text-light);
    margin: 0 0 12px;
}

.ef-card__location svg {
    flex-shrink: 0;
}

.ef-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Tags */
.ef-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ef-text-light);
    transition: all var(--ef-transition);
}

.ef-tag:hover {
    background: var(--ef-accent);
    color: #fff;
}

.ef-tag--more {
    background: var(--ef-primary);
    color: rgba(255,255,255,0.8);
}

/* ============================
 * Directory / Filters
 * ============================ */
.ef-directory {
    padding: 48px 0 80px;
}

.ef-directory__title {
    font-family: var(--ef-font-display);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ef-primary);
}

.ef-directory__subtitle {
    color: var(--ef-text-light);
    margin: 0 0 32px;
    font-size: 0.9375rem;
}

.ef-filters {
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: var(--ef-radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.ef-filters__row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.ef-filters__field {
    flex: 1;
    min-width: 180px;
}

.ef-filters__field--search {
    flex: 2;
}

.ef-filters__field--btn {
    flex: 0 0 auto;
    min-width: auto;
}

.ef-filters__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ef-text-light);
    margin-bottom: 6px;
}

.ef-filters__input,
.ef-filters__select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--ef-border);
    border-radius: var(--ef-radius);
    font-family: var(--ef-font-sans);
    font-size: 0.9375rem;
    color: var(--ef-text);
    background: #fff;
    transition: border-color var(--ef-transition);
}

.ef-filters__input:focus,
.ef-filters__select:focus {
    outline: none;
    border-color: var(--ef-accent);
}

/* ============================
 * No Results
 * ============================ */
.ef-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    color: var(--ef-text-light);
}

/* ============================
 * Pagination
 * ============================ */
.ef-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.ef-pagination__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--ef-border);
    border-radius: var(--ef-radius);
    background: var(--ef-surface);
    font-family: var(--ef-font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ef-text);
    cursor: pointer;
    transition: all var(--ef-transition);
}

.ef-pagination__btn:hover {
    border-color: var(--ef-accent);
    color: var(--ef-accent);
}

.ef-pagination__btn--active {
    background: var(--ef-accent);
    border-color: var(--ef-accent);
    color: #fff;
}

/* ============================
 * Loading
 * ============================ */
.ef-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--ef-text-light);
}

.ef-loading__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ef-border);
    border-top-color: var(--ef-accent);
    border-radius: 50%;
    animation: ef-spin 0.7s linear infinite;
}

.ef-loading__spinner--small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

@keyframes ef-spin {
    to { transform: rotate(360deg); }
}

/* ============================
 * Profile Page
 * ============================ */
.ef-breadcrumb {
    padding: 24px 0;
    font-size: 0.8125rem;
    color: var(--ef-text-light);
}

.ef-breadcrumb a {
    color: var(--ef-text-light);
}

.ef-breadcrumb a:hover {
    color: var(--ef-accent);
}

.ef-breadcrumb__sep {
    margin: 0 8px;
    opacity: 0.5;
}

.ef-profile {
    padding-bottom: 80px;
}

.ef-profile__header {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 48px;
    padding: 32px;
    background: var(--ef-surface);
    border-radius: var(--ef-radius-lg);
    border: 1px solid var(--ef-border);
}

.ef-profile__photo {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    border-radius: var(--ef-radius-lg);
    overflow: hidden;
    background: #f5f5f5;
}

.ef-profile__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ef-profile__photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
}

.ef-profile__name {
    font-family: var(--ef-font-display);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--ef-primary);
}

.ef-profile__location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ef-text-light);
    font-size: 0.9375rem;
    margin: 0 0 16px;
}

.ef-profile__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.ef-profile__social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.ef-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f3f4f6;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ef-text);
    transition: all var(--ef-transition);
}

.ef-social-link:hover {
    background: var(--ef-primary);
    color: #fff;
}

.ef-profile__section {
    margin-bottom: 40px;
}

.ef-profile__section-title {
    font-family: var(--ef-font-display);
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--ef-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ef-border);
}

.ef-profile__description {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ef-text);
}

.ef-profile__description p {
    margin: 0 0 16px;
}

/* Contact items */
.ef-profile__contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ef-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
}

.ef-contact-item svg {
    flex-shrink: 0;
    color: var(--ef-text-light);
}

.ef-contact-item a {
    color: var(--ef-accent);
}

.ef-contact-item a:hover {
    text-decoration: underline;
}

/* Portfolio grid */
.ef-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.ef-portfolio-item {
    aspect-ratio: 4 / 3;
    border-radius: var(--ef-radius);
    overflow: hidden;
    cursor: pointer;
}

.ef-portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ef-portfolio-item:hover img {
    transform: scale(1.05);
}

.ef-profile__back {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--ef-border);
}

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

.ef-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}

.ef-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.ef-lightbox__content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--ef-radius);
}

.ef-lightbox__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 4px 12px;
}

/* ============================
 * CTA Section
 * ============================ */
.ef-cta {
    padding: 80px 0;
    background: var(--ef-primary);
    color: #fff;
    text-align: center;
}

.ef-cta__title {
    font-family: var(--ef-font-display);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 12px;
}

.ef-cta__text {
    font-size: 1.0625rem;
    color: rgba(255,255,255,0.7);
    margin: 0 auto 28px;
    max-width: 480px;
    font-weight: 300;
}

/* ============================
 * Page Title
 * ============================ */
.ef-page-title {
    font-family: var(--ef-font-display);
    font-size: 2rem;
    font-weight: 600;
    margin: 48px 0 8px;
    color: var(--ef-primary);
}

.ef-page-subtitle {
    color: var(--ef-text-light);
    margin: 0 0 40px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ============================
 * Submission Form
 * ============================ */
.ef-form {
    padding-bottom: 80px;
}

.ef-form__fieldset {
    border: none;
    padding: 0;
    margin: 0 0 32px;
}

.ef-form__legend {
    font-family: var(--ef-font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ef-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ef-border);
    margin-bottom: 20px;
    width: 100%;
}

.ef-form__group {
    margin-bottom: 20px;
}

.ef-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ef-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ef-text);
    margin-bottom: 6px;
}

.ef-form__hint-inline {
    font-weight: 400;
    color: var(--ef-text-light);
}

.ef-form__input,
.ef-form__textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--ef-border);
    border-radius: var(--ef-radius);
    font-family: var(--ef-font-sans);
    font-size: 0.9375rem;
    color: var(--ef-text);
    background: #fff;
    transition: border-color var(--ef-transition);
    line-height: 1.5;
}

.ef-form__input:focus,
.ef-form__textarea:focus {
    outline: none;
    border-color: var(--ef-accent);
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.1);
}

.ef-form__textarea {
    resize: vertical;
    min-height: 120px;
}

.ef-form__hint {
    font-size: 0.8125rem;
    color: var(--ef-text-light);
    margin-top: 4px;
}

/* Checkboxes */
.ef-form__checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.ef-form__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid var(--ef-border);
    border-radius: var(--ef-radius);
    cursor: pointer;
    transition: all var(--ef-transition);
    font-size: 0.875rem;
}

.ef-form__checkbox:hover {
    border-color: var(--ef-accent);
}

.ef-form__checkbox input:checked + span {
    font-weight: 600;
    color: var(--ef-accent);
}

.ef-form__checkbox:has(input:checked) {
    border-color: var(--ef-accent);
    background: rgba(224, 122, 95, 0.05);
}

/* File Upload */
.ef-form__upload {
    position: relative;
    border: 2px dashed var(--ef-border);
    border-radius: var(--ef-radius-lg);
    padding: 32px;
    text-align: center;
    transition: all var(--ef-transition);
    cursor: pointer;
}

.ef-form__upload:hover {
    border-color: var(--ef-accent);
    background: rgba(224, 122, 95, 0.02);
}

.ef-form__file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.ef-form__upload-content {
    color: var(--ef-text-light);
}

.ef-form__upload-content svg {
    margin: 0 auto 8px;
}

.ef-form__upload-content p {
    margin: 4px 0;
    font-size: 0.9375rem;
}

.ef-form__upload-preview {
    margin-top: 16px;
}

.ef-form__upload-preview.has-preview {
    padding-top: 16px;
    border-top: 1px solid var(--ef-border);
}

.ef-form__upload-preview img {
    max-height: 200px;
    margin: 0 auto;
    border-radius: var(--ef-radius);
}

.ef-form__upload-preview--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.ef-form__upload-thumb img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--ef-radius);
}

/* Form actions */
.ef-form__actions {
    padding-top: 16px;
}

.ef-form__actions .ef-btn {
    width: 100%;
    justify-content: center;
}

.ef-btn__loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Form messages */
.ef-form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 64px 24px;
    color: var(--ef-success);
}

.ef-form-success h2 {
    font-family: var(--ef-font-display);
    font-size: 1.5rem;
    margin: 0;
}

.ef-form-success p {
    color: var(--ef-text);
    max-width: 400px;
}

.ef-form-error {
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--ef-radius);
    color: var(--ef-error);
    font-size: 0.9375rem;
    margin-top: 16px;
}

/* ============================
 * Responsive
 * ============================ */
@media (max-width: 768px) {
    .ef-hero {
        padding: 48px 0 40px;
    }

    .ef-hero__search-inner {
        flex-direction: column;
    }

    .ef-stats__grid {
        gap: 32px;
    }

    .ef-filters__row {
        flex-direction: column;
    }

    .ef-filters__field {
        min-width: 100%;
    }

    .ef-grid {
        grid-template-columns: 1fr;
    }

    .ef-profile__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ef-profile__location {
        justify-content: center;
    }

    .ef-profile__tags {
        justify-content: center;
    }

    .ef-profile__social {
        justify-content: center;
    }

    .ef-form__row {
        grid-template-columns: 1fr;
    }

    .ef-portfolio-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .ef-categories-grid {
        grid-template-columns: 1fr;
    }

    .ef-profile__photo {
        width: 140px;
        height: 140px;
    }

    .ef-portfolio-grid {
        grid-template-columns: 1fr;
    }

    .ef-form__checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================
 * WordPress Overrides
 * ============================ */
.ef-main .wp-block-post-content {
    max-width: none;
    padding: 0;
}

body.single-fotograaf .wp-site-blocks,
body.page-template-page-avaleht .wp-site-blocks,
body.page-template-page-kataloog .wp-site-blocks,
body.page-template-page-lisa-fotograaf .wp-site-blocks {
    padding-top: 0;
}

/* Hide default WP title on custom templates */
body.page-template-page-avaleht .wp-block-post-title,
body.page-template-page-kataloog .wp-block-post-title,
body.page-template-page-lisa-fotograaf .wp-block-post-title {
    display: none;
}
