/**
 * Salon Team Directory - Frontend Styles
 * Card layout: horizontal (image left, info right) on desktop
 * Vertical stack on mobile
 * Figma specs: Card 580×416, Info panel 250×398, Gap 30px
 */

/* ─── Reset & Base ─── */
.std-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.std-wrapper *,
.std-wrapper *::before,
.std-wrapper *::after {
    box-sizing: border-box;
}

/* ─── Layout ─── */
.std-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ─── Sidebar ─── */
.std-sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* ─── Heading ─── */
.std-heading {
    color: #8B0000;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* ─── Category List ─── */
.std-categories-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
}

.std-category-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 15px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    font-family: inherit;
    line-height: 1.4;
}

.std-category-link:hover {
    background-color: #a00000;
    color: #fff;
    border-left-color: #a00000;
}

.std-category-link.active {
    background-color: #8B0000;
    color: #fff;
    border-left-color: #8B0000;
}

.std-category-link:focus-visible {
    outline: 2px solid #8B0000;
    outline-offset: 2px;
}

/* ─── Search Box ─── */
.std-search-box {
    display: flex;
    gap: 0;
    margin-top: 15px;
}

.std-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    font-size: 14px;
    color: #333;
    outline: none;
    font-family: inherit;
    min-width: 0;
    transition: border-color 0.2s ease;
}

.std-search-input:focus {
    border-color: #8B0000;
}

.std-search-input::placeholder {
    color: #999;
}

.std-search-btn {
    padding: 8px 16px;
    background-color: #8B0000;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s ease;
    white-space: nowrap;
    font-family: inherit;
}

.std-search-btn:hover {
    background-color: #a00000;
}

.std-search-btn:focus-visible {
    outline: 2px solid #8B0000;
    outline-offset: 2px;
}

/* ─── Content Area ─── */
.std-content {
    flex: 1;
    min-width: 0;
}

/* ─── Experts Grid ─── */
.std-experts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* ════════════════════════════════════════════
   EXPERT CARD - Horizontal Layout
   Figma: 580 Hug × 416 Fixed, Horizontal flow, Gap 30
   Image on LEFT, Info on RIGHT
   ════════════════════════════════════════════ */

.std-expert-card {
    background: #f5f5f5;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    min-height: 416px;
}

.std-expert-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ─── Expert Image (Left Side) ─── */
.std-expert-image {
    width: 50%;
    min-width: 50%;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    align-self: stretch;
}

.std-expert-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}

.std-expert-card:hover .std-expert-image img {
    transform: scale(1.03);
}

/* ─── Expert Info (Right Side) ─── */
.std-expert-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.std-expert-name {
    color: #8B0000;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.std-expert-title {
    color: #555;
    font-size: 0.95em;
    margin: 0;
    line-height: 1.4;
}

/* ─── Sample Work Gallery ─── */
.std-sample-work {
    margin: 15px 0;
}

.std-sample-label {
    color: #333;
    font-size: 0.9em;
    font-style: italic;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.std-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.std-gallery-thumb {
    display: block;
    width: 55px;
    height: 55px;
    overflow: hidden;
    border-radius: 3px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.std-gallery-thumb:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.std-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Know More Button (Full Width at Bottom) ─── */
.std-know-more-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background-color: #8B0000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background-color 0.25s ease;
    margin-top: auto;
    border: none;
    cursor: pointer;
}

.std-know-more-btn:hover {
    background-color: #a00000;
    color: #fff;
    text-decoration: none;
}

.std-know-more-btn:focus-visible {
    outline: 2px solid #8B0000;
    outline-offset: 2px;
}

/* ─── Loading State ─── */
.std-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.std-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #8B0000;
    border-radius: 50%;
    animation: std-spin 0.7s linear infinite;
}

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

/* ─── No Results ─── */
.std-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1em;
}

/* ─── Card fade-in animation ─── */
.std-expert-card {
    animation: stdFadeIn 0.3s ease forwards;
}

@keyframes stdFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/*
 * ═══════════════════════════════════════
 *  RESPONSIVE BREAKPOINTS
 * ═══════════════════════════════════════
 */

/* Extra-large screens (27" monitors, 2560px+) */
@media (min-width: 2560px) {
    .std-experts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .std-expert-card {
        min-height: 480px;
    }

    .std-expert-name {
        font-size: 1.8em;
    }

    .std-heading {
        font-size: 2.2em;
    }

    .std-gallery-thumb {
        width: 70px;
        height: 70px;
    }
}

/* Large desktops (1920px - 2559px) */
@media (min-width: 1920px) and (max-width: 2559px) {
    .std-expert-card {
        min-height: 440px;
    }
}

/* Small desktop / Large tablet landscape (992px - 1199px) */
@media (max-width: 1199px) {
    .std-sidebar {
        width: 220px;
        min-width: 220px;
    }

    .std-experts-grid {
        grid-template-columns: 1fr;
    }

    .std-expert-card {
        min-height: 380px;
    }

    .std-expert-info {
        padding: 18px;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .std-layout {
        flex-direction: column;
    }

    .std-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        position: static;
        order: 0 !important;
    }

    .std-categories-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .std-category-link {
        width: auto;
        border-left: none;
        border-radius: 4px;
        padding: 6px 14px;
        font-size: 13px;
    }

    .std-search-box {
        max-width: 400px;
    }

    .std-experts-grid {
        grid-template-columns: 1fr;
    }

    .std-expert-card {
        flex-direction: row;
        min-height: 360px;
    }

    .std-expert-image {
        width: 45%;
        min-width: 45%;
    }
}

/* Large mobile (576px - 767px) - Switch to VERTICAL card */
@media (max-width: 767px) {
    .std-experts-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .std-expert-card {
        flex-direction: column !important;
        min-height: auto !important;
    }

    /* Full-width expert image */
    .std-expert-image {
        width: 100% !important;
        min-width: 100% !important;
        height: 420px;
    }

    /* Spacious info section */
    .std-expert-info {
        padding: 20px 20px 0 20px;
    }

    .std-expert-name {
        font-size: 1.5em;
        margin-bottom: 4px;
    }

    .std-expert-title {
        font-size: 1em;
        margin-bottom: 10px;
    }

    /* Sample Work: 2-column grid with large images */
    .std-sample-work {
        margin: 15px 0 20px 0;
    }

    .std-sample-label {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .std-gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        flex-wrap: nowrap;
    }

    .std-gallery-thumb {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 4;
        border-radius: 4px;
    }

    .std-gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Full-width button at bottom */
    .std-know-more-btn {
        display: block;
        width: calc(100% + 40px) !important;
        margin-left: -20px;
        margin-right: -20px;
        margin-top: 20px;
        border-radius: 0;
    }

    .std-heading {
        font-size: 1.4em;
    }
}

/* Small mobile (< 576px) */
@media (max-width: 575px) {
    .std-expert-card {
        flex-direction: column !important;
        min-height: auto !important;
    }

    .std-expert-image {
        width: 100% !important;
        min-width: 100% !important;
        height: 380px;
    }

    .std-categories-list {
        flex-direction: column;
        gap: 3px;
    }

    .std-category-link {
        width: 100%;
        border-radius: 0;
        border-left: 3px solid transparent;
    }

    .std-search-box {
        max-width: 100%;
    }

    .std-know-more-btn {
        padding: 14px 20px;
        font-size: 14px;
        width: calc(100% + 30px) !important;
        margin-left: -15px;
        margin-right: -15px;
    }

    .std-expert-info {
        padding: 15px 15px 0 15px;
    }

    .std-gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .std-gallery-thumb {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 4;
    }
}

/* ─── Accessibility ─── */
@media (prefers-reduced-motion: reduce) {
    .std-expert-card,
    .std-expert-image img,
    .std-gallery-thumb,
    .std-spinner {
        animation: none !important;
        transition: none !important;
    }
}

/* ─── Print ─── */
@media print {
    .std-search-box,
    .std-loading {
        display: none !important;
    }

    .std-layout {
        display: block;
    }

    .std-sidebar {
        width: 100% !important;
        position: static;
    }

    .std-experts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .std-expert-card {
        break-inside: avoid;
    }
}
