/* ============================================================
   TADVIN 724 — SINGLE PORTFOLIO PAGE
   Phone-frame video + side info panel.
   ============================================================ */

.td-ps {
    padding-bottom: var(--lc-space-8);
    background: var(--lc-color-background);
}

/* ============================================================
   1. COMPACT BREADCRUMB TOPBAR
   ============================================================ */

.td-ps__topbar {
    padding: var(--lc-space-3) 0;
    background: var(--lc-color-background-alt);
    border-bottom: 1px solid var(--lc-color-border-light);
}

.td-ps__breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--lc-font-size-xs);
    color: var(--lc-color-text-muted);
}

.td-ps__breadcrumb-list a {
    color: var(--lc-color-text-secondary);
    text-decoration: none;
    transition: color var(--lc-transition-fast);
}

.td-ps__breadcrumb-list a:hover {
    color: var(--lc-color-primary);
}

.td-ps__breadcrumb-list [aria-current] {
    color: var(--lc-color-primary);
    font-weight: var(--lc-font-weight-semibold);
}

/* ============================================================
   2. SHOWCASE — two-column grid
   ============================================================ */

.td-ps__showcase {
    padding: var(--lc-space-6) 0 var(--lc-space-5);
    background: var(--lc-color-background);
}

.td-ps__showcase--no-video {
    padding: var(--lc-space-6) 0;
}

.td-ps__showcase-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: var(--lc-space-6);
    align-items: start;
}

@media (max-width: 992px) {
    .td-ps__showcase-grid {
        grid-template-columns: 1fr;
        gap: var(--lc-space-5);
    }
}

/* ============================================================
   3. PHONE FRAME — 9:19 portrait with notch + home bar
   ============================================================ */

.td-ps__phone {
    position: relative;
    width: 340px;
    max-width: 100%;
    aspect-ratio: 9 / 19.5;
    margin-inline: auto;
    padding: 14px 14px 22px;
    background: #1A1416;
    border-radius: 42px;
    box-shadow:
        0 30px 60px -20px rgba(25, 8, 8, 0.4),
        0 0 0 2px rgba(251, 250, 248, 0.06),
        inset 0 1px 1px rgba(251, 250, 248, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 992px) {
    .td-ps__phone {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .td-ps__phone {
        width: 260px;
        padding: 12px 12px 18px;
        border-radius: 34px;
    }
}

/* Top bar / notch */
.td-ps__phone-bar {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.td-ps__phone-notch {
    display: block;
    width: 90px;
    height: 22px;
    background: #000;
    border-radius: 0 0 16px 16px;
    position: relative;
}

.td-ps__phone-notch::before {
    content: '';
    position: absolute;
    top: 7px;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 6px;
    background: #1A1416;
    border-radius: 10px;
}

/* Video screen */
.td-ps__phone-screen {
    position: relative;
    flex: 1;
    background: #000;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(251, 250, 248, 0.05);
}

.td-ps__phone-screen iframe,
.td-ps__phone-screen video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

/* Bottom home bar */
.td-ps__phone-home {
    height: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    flex-shrink: 0;
}

.td-ps__phone-home-bar {
    display: block;
    width: 110px;
    height: 4px;
    background: rgba(251, 250, 248, 0.5);
    border-radius: 4px;
}

/* ============================================================
   4. INFO PANEL
   ============================================================ */

.td-ps__panel {
    display: flex;
    flex-direction: column;
    gap: var(--lc-space-4);
    padding-top: var(--lc-space-2);
}

@media (max-width: 992px) {
    .td-ps__panel {
        padding: var(--lc-space-4);
        background: var(--lc-color-background-alt);
        border-radius: var(--lc-radius-lg);
    }
}

/* Featured badge */
.td-ps__panel-featured {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 4px;
    padding: 4px var(--lc-space-3);
    background: var(--lc-color-primary);
    color: #FBFAF8;
    border-radius: var(--lc-radius-full);
    font-size: var(--lc-font-size-xs);
    font-weight: var(--lc-font-weight-bold);
}

.td-ps__panel-featured svg {
    color: #FCD34D;
}

/* Categories */
.td-ps__panel-cats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lc-space-2);
}

.td-ps__panel-cat {
    display: inline-flex;
    padding: 4px var(--lc-space-3);
    background: var(--lc-color-primary-light);
    color: var(--lc-color-primary);
    border-radius: var(--lc-radius-full);
    font-size: var(--lc-font-size-xs);
    font-weight: var(--lc-font-weight-semibold);
    text-decoration: none;
    transition: all var(--lc-transition-fast);
}

.td-ps__panel-cat:hover {
    background: var(--lc-color-primary);
    color: #FBFAF8;
}

/* Title */
.td-ps__panel-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: var(--lc-font-weight-black);
    color: var(--lc-color-text);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* Description */
.td-ps__panel-description {
    font-size: var(--lc-font-size-md);
    line-height: 1.85;
    color: var(--lc-color-text-secondary);
}

.td-ps__panel-description > * + * {
    margin-top: var(--lc-space-3);
}

.td-ps__panel-description h2 {
    margin-top: var(--lc-space-4);
    margin-bottom: var(--lc-space-2);
    font-size: var(--lc-font-size-lg);
    font-weight: var(--lc-font-weight-bold);
    color: var(--lc-color-text);
    padding-bottom: var(--lc-space-2);
    border-bottom: 2px solid var(--lc-color-primary-light);
    display: inline-block;
}

.td-ps__panel-description h3 {
    margin-top: var(--lc-space-3);
    font-size: var(--lc-font-size-md);
    font-weight: var(--lc-font-weight-semibold);
    color: var(--lc-color-text);
}

.td-ps__panel-description a {
    color: var(--lc-color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.td-ps__panel-description ul,
.td-ps__panel-description ol {
    padding-inline-start: var(--lc-space-5);
}

.td-ps__panel-description li {
    margin-bottom: var(--lc-space-1);
}

.td-ps__panel-description img {
    max-width: 100%;
    height: auto;
    border-radius: var(--lc-radius-md);
    margin: var(--lc-space-3) 0;
}

/* Details grid */
.td-ps__panel-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--lc-space-3);
    padding: var(--lc-space-4);
    background: var(--lc-color-background-alt);
    border: 1px solid var(--lc-color-border-light);
    border-radius: var(--lc-radius-md);
}

@media (max-width: 640px) {
    .td-ps__panel-details {
        grid-template-columns: 1fr;
    }
}

.td-ps__panel-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.td-ps__panel-detail-label {
    font-size: var(--lc-font-size-xs);
    color: var(--lc-color-text-muted);
    font-weight: var(--lc-font-weight-medium);
}

.td-ps__panel-detail-value {
    font-size: var(--lc-font-size-sm);
    font-weight: var(--lc-font-weight-bold);
    color: var(--lc-color-text);
}

/* Inline CTA */
.td-ps__panel-cta {
    padding: var(--lc-space-4);
    background:
        radial-gradient(ellipse at top right, rgba(99, 20, 20, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(56, 13, 14, 0.55) 0%, transparent 60%),
        #190808;
    border-radius: var(--lc-radius-md);
    color: #FBFAF8;
}

.td-ps__panel-cta-title {
    margin: 0 0 4px;
    font-size: var(--lc-font-size-md);
    font-weight: var(--lc-font-weight-black);
    color: #FBFAF8;
    line-height: 1.3;
}

.td-ps__panel-cta-text {
    margin: 0 0 var(--lc-space-3);
    font-size: var(--lc-font-size-sm);
    color: rgba(251, 250, 248, 0.75);
    line-height: 1.6;
}

.td-ps__panel-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--lc-space-2);
}

.td-ps__panel-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--lc-space-2) var(--lc-space-4);
    border: 1px solid transparent;
    border-radius: var(--lc-radius-sm);
    font-family: inherit;
    font-size: var(--lc-font-size-sm);
    font-weight: var(--lc-font-weight-semibold);
    text-decoration: none;
    transition: all var(--lc-transition-fast);
    min-height: 40px;
    white-space: nowrap;
}

.td-ps__panel-cta-btn--primary {
    background: #FBFAF8;
    color: var(--lc-color-primary);
    border-color: #FBFAF8;
}

.td-ps__panel-cta-btn--primary:hover {
    background: #F3EFEC;
    border-color: #F3EFEC;
    color: var(--lc-color-primary-hover);
    transform: translateY(-1px);
}

.td-ps__panel-cta-btn--ghost {
    background: transparent;
    color: #FBFAF8;
    border-color: rgba(251, 250, 248, 0.3);
    font-feature-settings: "tnum";
}

.td-ps__panel-cta-btn--ghost:hover {
    background: rgba(251, 250, 248, 0.1);
    border-color: #FBFAF8;
    color: #FBFAF8;
}

[dir="rtl"] .td-ps__panel-cta-btn--primary svg {
    transform: rotate(180deg);
}

/* Share */
.td-ps__panel-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--lc-space-2);
    padding-top: var(--lc-space-3);
    border-top: 1px solid var(--lc-color-border);
}

.td-ps__panel-share-label {
    font-size: var(--lc-font-size-xs);
    color: var(--lc-color-text-muted);
    font-weight: var(--lc-font-weight-semibold);
    margin-inline-end: 4px;
}

.td-ps__panel-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--lc-color-background-alt);
    border: 1px solid var(--lc-color-border);
    border-radius: var(--lc-radius-sm);
    color: var(--lc-color-text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--lc-transition-fast);
    font-family: inherit;
    padding: 0;
}

.td-ps__panel-share-btn:hover {
    background: var(--lc-color-primary);
    border-color: var(--lc-color-primary);
    color: #FBFAF8;
    transform: translateY(-2px);
}

/* ============================================================
   5. PREV / NEXT NAVIGATION
   ============================================================ */

.td-ps__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lc-space-3);
    margin-top: var(--lc-space-6);
    padding-top: var(--lc-space-5);
    border-top: 1px solid var(--lc-color-border);
}

@media (max-width: 640px) {
    .td-ps__nav {
        grid-template-columns: 1fr;
    }
}

.td-ps__nav-card {
    display: flex;
    align-items: center;
    gap: var(--lc-space-3);
    padding: var(--lc-space-3);
    background: var(--lc-color-background);
    border: 1px solid var(--lc-color-border);
    border-radius: var(--lc-radius-md);
    text-decoration: none;
    color: var(--lc-color-text);
    transition: all var(--lc-transition-fast);
    min-height: 80px;
}

.td-ps__nav-card:hover {
    border-color: var(--lc-color-primary);
    background: var(--lc-color-primary-lighter, #FBFAF8);
    transform: translateY(-2px);
    box-shadow: var(--lc-shadow-sm);
}

.td-ps__nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--lc-color-primary-light);
    color: var(--lc-color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.td-ps__nav-card--next .td-ps__nav-arrow {
    order: 99;
}

.td-ps__nav-thumb {
    width: 64px;
    height: 48px;
    border-radius: var(--lc-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--lc-color-background-alt);
}

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

.td-ps__nav-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.td-ps__nav-card--next .td-ps__nav-body {
    text-align: end;
}

.td-ps__nav-label {
    font-size: var(--lc-font-size-xs);
    color: var(--lc-color-text-muted);
    font-weight: var(--lc-font-weight-semibold);
}

.td-ps__nav-title {
    font-size: var(--lc-font-size-sm);
    font-weight: var(--lc-font-weight-bold);
    color: var(--lc-color-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-ps__nav-card:hover .td-ps__nav-title {
    color: var(--lc-color-primary);
}

/* ============================================================
   6. BACK LINK
   ============================================================ */

.td-ps__back {
    margin-top: var(--lc-space-5);
    padding-bottom: var(--lc-space-5);
    text-align: center;
}

.td-ps__back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--lc-space-2) var(--lc-space-4);
    background: var(--lc-color-background-alt);
    border: 1px solid var(--lc-color-border);
    border-radius: var(--lc-radius-full);
    font-size: var(--lc-font-size-sm);
    font-weight: var(--lc-font-weight-semibold);
    color: var(--lc-color-text-secondary);
    text-decoration: none;
    transition: all var(--lc-transition-fast);
}

.td-ps__back a:hover {
    border-color: var(--lc-color-primary);
    color: var(--lc-color-primary);
    background: var(--lc-color-primary-light);
}

/* ============================================================
   7. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .td-ps__showcase {
        padding: var(--lc-space-5) 0 var(--lc-space-4);
    }

    .td-ps__panel-title {
        font-size: 1.5rem;
    }

    .td-ps__panel-cta-actions {
        flex-direction: column;
    }

    .td-ps__panel-cta-actions .td-ps__panel-cta-btn {
        width: 100%;
    }

    .td-ps__nav-card {
        min-height: auto;
    }

    .td-ps__nav-thumb {
        width: 56px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .td-ps__panel-cat {
        font-size: 10px;
        padding: 3px 10px;
    }

    .td-ps__panel-share-btn {
        width: 32px;
        height: 32px;
    }
}

/* ============================================================
   8. ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .td-ps__panel-cat,
    .td-ps__panel-cta-btn,
    .td-ps__panel-share-btn,
    .td-ps__nav-card,
    .td-ps__back a {
        transition: none !important;
        transform: none !important;
    }
}

@media (prefers-contrast: high) {
    .td-ps__panel-details,
    .td-ps__nav-card,
    .td-ps__panel-share-btn,
    .td-ps__back a {
        border-width: 2px;
    }

    .td-ps__phone {
        border: 2px solid #FBFAF8;
    }
}

/* ============================================================
   APARAT EMBED — official wrapper + iframe rules
   ============================================================ */

.h_iframe-aparat_embed_frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.h_iframe-aparat_embed_frame .ratio {
    display: block;
    width: 100%;
    height: auto;
}

.h_iframe-aparat_embed_frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Inside the phone frame, ensure the wrapper fills the screen area */
.td-ps__phone-screen .h_iframe-aparat_embed_frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.td-ps__phone-screen .h_iframe-aparat_embed_frame span {
    padding-top: 0 !important;   /* phone frame already has its own ratio */
    position: absolute;
    inset: 0;
}

/* Ensure the phone screen contains absolutely positioned children */
.td-ps__phone-screen {
    position: relative;  /* already set, but ensures it's the containing block */
}