
/* ==========================================
   TARNIMATY - DESIGN SYSTEM
========================================== */

:root { --tm-bg: #FAF9F6; --tm-white: #FFFFFF; --tm-text: #303E55; --tm-muted: #87918F; --tm-blue: #35479C; --tm-purple: #7953A4; --tm-orange: #ED901E; --tm-border: #E9E8E3; --tm-soft: #F5F5F2; --font-ui: 'Tajawal', Tahoma, sans-serif; --font-lyrics: 'Amiri', 'Noto Naskh Arabic', serif; }

* { box-sizing: border-box; }

html { direction: rtl; }

body { margin: 0; background: var(--tm-bg); color: var(--tm-text); font-family: var(--font-ui); }

button,
input,
select { font-family: var(--font-ui); }

button { cursor: pointer; }

/* ==========================================
   HEADER
========================================== */

.site-header { background: var(--tm-white); border-bottom: 1px solid var(--tm-border); position: sticky; top: 0; z-index: 1000; }

.header-inner { max-width: 1240px; margin: auto; min-height: 90px; padding: 12px 28px; display: flex; justify-content: space-between; align-items: center; }

.site-brand { display: inline-flex; align-items: center; text-decoration: none; }

.site-logo { display: block; max-width: 160px; max-height: 67px; width: auto; height: auto; object-fit: contain; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.header-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; position: relative; background: white; border: 1px solid var(--tm-border); border-radius: 10px; color: var(--tm-text); font-size: 19px; transition: background .2s, border-color .2s; }

    .header-icon:hover { background: #F4F3F8; border-color: #DCD6E9; }

    .header-icon.search-icon { background: #F0F1FA; color: var(--tm-blue); border-color: #E2E4F3; }

        .header-icon.search-icon:hover { background: #E6E9F7; }

.book-count { position: absolute; top: -7px; left: -6px; min-width: 18px; height: 18px; padding: 1px 4px; background: var(--tm-orange); color: white; border-radius: 20px; font-size: 11px; display: flex; align-items: center; justify-content: center; }

/* ==========================================
   MAIN CONTENT
========================================== */

.site-main { min-height: calc(100vh - 155px); }

.tarnimaty-page { max-width: 1100px; margin: 36px auto 50px; padding: 0 20px; }

.song-card { background: var(--tm-white); border: 1px solid var(--tm-border); border-radius: 16px; box-shadow: 0 8px 35px rgba(30, 35, 55, .035); overflow: hidden; }

/* ==========================================
   SONG TOOLBAR
========================================== */

.song-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; }

.related-trigger { border: 1px solid var(--tm-border); border-radius: 9px; background: #FAFAF9; color: #646B80; padding: 10px 14px; font-size: 13px; }

    .related-trigger:hover { background: #F2F1F7; }

    .related-trigger i { margin-left: 6px; }

.fullscreen-trigger { width: 42px; height: 42px; border: 1px solid #E0E2EE; border-radius: 9px; background: #F5F6FB; color: var(--tm-blue); font-size: 20px; display: flex; align-items: center; justify-content: center; }

    .fullscreen-trigger:hover { background: #E9ECF8; }

/* ==========================================
   SONG TITLE AND METADATA
========================================== */

.song-heading { text-align: center; padding: 12px 25px 38px; }

    .song-heading h1 { font-family: var(--font-lyrics); font-size: clamp(35px, 4.5vw, 49px); font-weight: 700; color: var(--tm-text); line-height: 1.65; margin: 0 0 12px; }

.song-metadata { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 26px; color: var(--tm-muted); font-size: 14px; margin-bottom: 25px; }

    .song-metadata strong { font-weight: 700; color: #485576; }

/* ==========================================
   SONG ACTIONS
========================================== */

.song-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

    .song-actions button { border: 1px solid var(--tm-border); background: white; color: var(--tm-text); border-radius: 9px; padding: 11px 18px; font-size: 14px; font-weight: 700; transition: background .2s; }

        .song-actions button:hover { background: var(--tm-soft); }

        .song-actions button i { margin-left: 7px; }

    .song-actions .add-to-book { background: var(--tm-blue); color: white; border-color: var(--tm-blue); }

        .song-actions .add-to-book:hover { background: #293B8B; }

/* ==========================================
   SONG LYRICS
========================================== */

.song-lyrics { width: 84%; margin: auto; padding: 25px 0 35px; border-top: 1px solid var(--tm-border); font-family: var(--font-lyrics); font-size: clamp(21px, 2.5vw, 29px); font-weight: 400; line-height: 2.15; color: #293542; text-align: center; direction: rtl; }

    /* Legacy verse container */
    .song-lyrics .trow { display: grid; grid-template-columns: 45px minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: start; margin: 0; padding: 25px 0; border-bottom: 1px solid #F0EFEB; }

    /* Original verse number */
    .song-lyrics .adad { grid-column: 1; color: var(--tm-purple); font-family: var(--font-ui); font-size: 14px; padding-top: 10px; }

    /* Original right-hand lyrics */
    .song-lyrics .rght,
    .song-lyrics .rghtl { grid-column: 2; text-align: center; min-width: 0; }

    /* Original left-hand lyrics */
    .song-lyrics .lft,
    .song-lyrics .lfts { grid-column: 3; text-align: center; min-width: 0; }

    /* Empty spacing column from legacy HTML */
    .song-lyrics .cntr { display: none; }

    /* Refrain / chorus */
    .song-lyrics .karar { color: #35446F; text-align: center; padding: 25px 0; }

    /* Centered chorus inside a verse */
    .song-lyrics .kararcentered { grid-column: 2 / 4; text-align: center; color: #35446F; margin-top: 12px; }

    /* Combined refrain */
    .song-lyrics .threeinone { text-align: center; }

    .song-lyrics .trow > .threeinone { grid-column: 2 / 4; }

    /* Legacy chorus without trow */
    .song-lyrics > .karar:not(.trow) { border-bottom: 1px solid #F0EFEB; }

/* ==========================================
   TAGS
========================================== */

.song-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 0 8%; padding: 25px 0 35px; border-top: 1px solid var(--tm-border); }

.song-tag { border: 1px solid #E4DDF0; background: #F7F4FA; color: var(--tm-purple); padding: 7px 14px; border-radius: 30px; font-size: 13px; }

/* ==========================================
   EMPTY STATE
========================================== */

.empty-song { text-align: center; padding: 90px 25px; }

    .empty-song h2 { font-family: var(--font-lyrics); color: var(--tm-text); }

/* ==========================================
   FOOTER
========================================== */

.site-footer { text-align: center; padding: 20px; font-size: 12px; color: #9A9D9C; }

/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 768px) {

    .header-inner { min-height: 72px; padding: 10px 15px; }

    .site-logo { max-width: 115px; max-height: 55px; }

    .header-actions { gap: 6px; }

    .header-icon { width: 37px; height: 37px; font-size: 17px; }

    .tarnimaty-page { margin-top: 18px; padding: 0 12px; }

    .song-toolbar { padding: 13px; }

    .song-heading { padding: 15px 15px 30px; }

        .song-heading h1 { font-size: 34px; }

    .song-lyrics { width: 94%; font-size: 21px; line-height: 1.95; }

        .song-lyrics .trow { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }

        .song-lyrics .adad { font-size: 12px; }

    .song-metadata { font-size: 12px; gap: 8px 14px; }
}

@media (max-width: 480px) {

    .song-lyrics { font-size: 18px; }

    .song-heading h1 { font-size: 30px; }

    .song-actions button { font-size: 12px; padding: 9px 12px; }

    .related-trigger { font-size: 11px; }
}

/* Tarnimaty layout refinements */

.site-header { width: 100%; }

.header-inner { max-width: 1240px; min-height: 78px; margin: 0 auto; padding: 8px 24px; }

.site-logo { max-width: 130px; max-height: 64px; }

.tarnimaty-page { margin-top: 24px; }

.song-heading { padding-top: 0; padding-bottom: 25px; }

    .song-heading h1 { margin-top: 0; margin-bottom: 8px; }

.song-lyrics { padding-top: 12px; }

    .song-lyrics .trow { padding: 18px 0; }

.site-footer { border-top: 1px solid var(--tm-border); }

/* ==========================================
   INTERACTIVE PANELS
========================================== */

.tm-backdrop { position: fixed; inset: 0; background: rgba(24, 31, 48, .42); z-index: 1900; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }

    .tm-backdrop.open { opacity: 1; visibility: visible; }

.tm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); background: #fff; z-index: 1901; transform: translateX(105%); transition: transform .28s ease; box-shadow: -12px 0 45px rgba(0,0,0,.08); display: flex; flex-direction: column; direction: rtl; }

    .tm-drawer.open { transform: translateX(0); }

.tm-panel-open { overflow: hidden; }

.tm-drawer-header { padding: 24px; border-bottom: 1px solid var(--tm-border); display: flex; align-items: center; justify-content: space-between; }

    .tm-drawer-header h2 { margin: 0; font-size: 21px; font-weight: 700; }

    .tm-drawer-header button,
    .tm-presentation-toolbar button { border: 0; background: transparent; color: inherit; font-size: 22px; }

.tm-drawer-content { padding: 25px; overflow-y: auto; flex: 1; }

.tm-panel-message { color: var(--tm-muted); font-size: 15px; line-height: 1.9; }

.tm-search-input { width: 100%; padding: 15px; border: 1px solid var(--tm-border); border-radius: 10px; background: var(--tm-bg); margin-bottom: 15px; direction: rtl; }

    .tm-search-input:focus { outline: 2px solid var(--tm-blue); outline-offset: 1px; }

.tm-book-item { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--tm-border); font-family: var(--font-lyrics); font-size: 21px; }

    .tm-book-item button { border: 0; background: transparent; color: var(--tm-purple); font-family: var(--font-ui); font-size: 13px; }

#tmFontSlider { width: 100%; margin-top: 20px; accent-color: var(--tm-blue); }

/* Settings-driven font scaling */
.song-lyrics { font-size: calc(28px * var(--tm-lyrics-scale, 1)); }

/* ==========================================
   FULLSCREEN PRESENTATION
========================================== */

.tm-presentation { position: fixed; inset: 0; z-index: 3000; background: #FAF9F6; display: none; flex-direction: column; direction: rtl; color: var(--tm-text); }

    .tm-presentation.open { display: flex; }

.tm-presentation-open { overflow: hidden; }

.tm-presentation-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 30px; color: var(--tm-muted); font-family: var(--font-ui); }

.tm-slide { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 20px; overflow-y: auto; }

.tm-slide-lyrics { width: min(100%, 1100px); border: 0; padding: 0; font-size: calc(40px * var(--tm-lyrics-scale, 1)); line-height: 2; text-align: center; }

    .tm-slide-lyrics .trow { border: 0; margin: 0; padding: 0; }

.tm-presentation-controls { display: flex; justify-content: center; gap: 20px; padding: 20px; }

    .tm-presentation-controls button { padding: 11px 30px; border-radius: 9px; border: 1px solid var(--tm-border); background: white; color: var(--tm-text); font-family: var(--font-ui); }

        .tm-presentation-controls button:hover { background: #F0F1F8; }

@media (max-width: 768px) {
    .song-lyrics { font-size: calc(21px * var(--tm-lyrics-scale, 1)); }

    .tm-slide-lyrics { font-size: calc(25px * var(--tm-lyrics-scale, 1)); }

    .tm-presentation-toolbar { padding: 15px; }

    .tm-slide { padding: 12px; }
}

/* ==========================================
   FULLSCREEN HIGH CONTRAST MODE
========================================== */

/* Toolbar layout */

.tm-presentation-tools { display: flex; align-items: center; gap: 24px; }

.tm-contrast-control { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-family: var(--font-ui); font-size: 14px; font-weight: 600; }

    .tm-contrast-control input { width: 17px; height: 17px; accent-color: var(--tm-blue); cursor: pointer; }

/* High contrast presentation */

.tm-presentation.high-contrast { background: #000000; color: #FFFFFF; }

    /* Lyrics, including legacy verse formatting */

    .tm-presentation.high-contrast .tm-slide,
    .tm-presentation.high-contrast .tm-slide-lyrics,
    .tm-presentation.high-contrast .tm-slide-lyrics * { color: #FFFFFF !important; background-color: transparent !important; border-color: #444444 !important; }

    /* Fullscreen controls */

    .tm-presentation.high-contrast .tm-presentation-toolbar { color: #FFFFFF; }

    .tm-presentation.high-contrast .tm-presentation-controls button { background: #151515; color: #FFFFFF; border-color: #777777; }

        .tm-presentation.high-contrast .tm-presentation-controls button:hover { background: #303030; }

    .tm-presentation.high-contrast
    .tm-contrast-control input { accent-color: #FFFFFF; }
.tm-book-link { color: var(--tm-text); text-decoration: none; flex: 1; }

    .tm-book-link:hover { color: var(--tm-blue); text-decoration: underline; }

/* ==========================================
   LIVE SEARCH RESULTS
========================================== */

.tm-search-results { display: flex; flex-direction: column; gap: 4px; }

.tm-search-result { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 12px; border-bottom: 1px solid var(--tm-border); text-decoration: none; color: var(--tm-text); border-radius: 7px; transition: background .2s; }

    .tm-search-result:hover { background: #F4F3F8; }

.tm-result-title { font-family: var(--font-lyrics); font-size: 21px; line-height: 1.5; }

.tm-result-type { flex-shrink: 0; font-family: var(--font-ui); font-size: 11px; color: var(--tm-muted); }

@media (max-width: 480px) {
    .tm-result-title { font-size: 18px; }

    .tm-result-type { font-size: 10px; }
}

/* ==========================================
   SONGBOOK MANAGEMENT
========================================== */

.tm-book-present { width: 100%; padding: 14px; margin-bottom: 14px; border: 0; border-radius: 10px; background: var(--tm-blue); color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: 15px; }

    .tm-book-present i { margin-left: 8px; }

.tm-book-list { display: flex; flex-direction: column; }

.tm-book-item { display: flex; align-items: center; gap: 9px; padding: 13px 6px; border-bottom: 1px solid var(--tm-border); font-size: 18px; }

    .tm-book-item.dragging { opacity: .4; }

.tm-drag-handle { cursor: grab; color: #A0A0AC; touch-action: none; }

.tm-book-number { color: var(--tm-muted); font-family: var(--font-ui); font-size: 12px; }

.tm-book-link { flex: 1; min-width: 0; color: var(--tm-text); text-decoration: none; font-family: var(--font-lyrics); font-size: 19px; }

    .tm-book-link:hover { color: var(--tm-blue); }

.tm-book-item-actions { display: flex; gap: 3px; }

    .tm-book-item-actions button { width: 29px; height: 32px; display: inline-flex; justify-content: center; align-items: center; border: 0; background: transparent; color: #67718A; font-size: 14px; }

        .tm-book-item-actions button:hover:not(:disabled) { background: var(--tm-soft); }

        .tm-book-item-actions button:disabled { opacity: .25; cursor: default; }

/* ==========================================
   PREVIOUS / NEXT SONG NAVIGATION
========================================== */

.tm-book-navigation { margin: 24px auto 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }

    .tm-book-navigation button { border: 1px solid var(--tm-border); background: var(--tm-white); color: var(--tm-blue); border-radius: 8px; padding: 10px 16px; font-family: var(--font-ui); font-size: 13px; font-weight: 700; }

        .tm-book-navigation button:hover:not(:disabled) { background: #F0F1FA; }

        .tm-book-navigation button:disabled { opacity: .35; cursor: default; }

.tm-book-position { color: var(--tm-muted); font-size: 12px; }

@media (max-width: 480px) {
    .tm-book-item { gap: 5px; }

    .tm-book-link { font-size: 17px; }

    .tm-book-navigation button { padding: 9px 10px; font-size: 12px; }
}

/* Fullscreen: current hymn title */

.tm-presentation-title { flex: 1; min-width: 0; padding: 0 20px; text-align: center; font-family: var(--font-lyrics); font-size: 22px; font-weight: 700; color: var(--tm-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tm-presentation.high-contrast .tm-presentation-title { color: #fff; }

@media (max-width: 768px) {
    .tm-presentation-title { font-size: 17px; padding: 0 10px; }
}

/* ==========================================
   TARNIMATY SEARCH
========================================== */

.tm-search-input { font-family: var(--font-ui); font-size: 16px; min-height: 52px; }

.tm-search-results { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }

.tm-search-count { font-family: var(--font-ui); color: var(--tm-muted); font-size: 12px; margin: 4px 0 12px; }

.tm-search-result { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 15px; border: 1px solid transparent; border-bottom-color: var(--tm-border); border-radius: 8px; text-decoration: none; color: var(--tm-text); transition: background .15s; }

    .tm-search-result:hover,
    .tm-search-result.active,
    .tm-search-result:focus-visible { background: #F2F1F9; border-color: #E3DFF0; color: var(--tm-blue); outline: none; }

.tm-result-title { flex: 1; min-width: 0; font-family: var(--font-lyrics); font-size: 21px; line-height: 1.5; }

.tm-result-type { flex-shrink: 0; color: var(--tm-muted); background: #F5F5F3; border-radius: 20px; padding: 5px 10px; font-family: var(--font-ui); font-size: 11px; }

.tm-search-result.active .tm-result-type,
.tm-search-result:hover .tm-result-type { background: #E6E4F3; color: var(--tm-blue); }

@media (max-width: 480px) {
    .tm-result-title { font-size: 18px; }
}


/* ===================================
   STRUCTURED SONG LYRICS
=================================== */

.song-lyrics { direction: rtl; }

.song-verse-block { margin-bottom: 36px; }

.song-verse-heading { text-align: center; font-size: 13px; font-weight: 600; opacity: .55; margin-bottom: 14px; }

.song-verse-lines { display: grid; direction: rtl; gap: 8px 32px; width: 100%; }

/* One column */
.song-lyrics[data-layout="one"] .song-verse-lines { grid-template-columns: minmax(0, 1fr); }

/* Two columns: 1|2, then 3|4 */
.song-lyrics[data-layout="two"] .song-verse-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.song-verse-line { min-width: 0; text-align: center; overflow-wrap: break-word; font-family: 'Amiri', serif; font-size: inherit; line-height: 1.8; }

/* Last unpaired line spans both columns */
.song-lyrics[data-layout="two"]
.song-verse-line:last-child:nth-child(odd) { grid-column: 1 / -1; }

.song-lyrics-empty { text-align: center; padding: 50px 15px; opacity: .6; }

@media (max-width: 650px) {
    .song-lyrics[data-layout="two"] .song-verse-lines { column-gap: 12px; }
}

/* Layout switch */

/* LYRICS LAYOUT TOOLBAR */


/* =========================================
   SONG TOOLBAR LAYOUT
========================================= */

.song-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.song-toolbar-left { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* Compact segmented column switch */

.song-toolbar .lyrics-layout-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #e1e4e9; border-radius: 8px; background: transparent; width: fit-content; }

    .song-toolbar .lyrics-layout-switch button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #858b98; font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }

        .song-toolbar .lyrics-layout-switch button:hover { color: #39489a; background: #f1f3f9; }

        .song-toolbar .lyrics-layout-switch button.active { background: #e9edf9; color: #39489a; }

/* Keep controls aligned */

.song-toolbar .fullscreen-trigger { flex-shrink: 0; }

@media (max-width: 575px) {
    .song-toolbar { gap: 8px; }

    .song-toolbar-left { gap: 5px; }

    .song-toolbar .lyrics-layout-switch button { width: 30px; height: 30px; }
}

/* ==========================================
   UNIFIED SONG TOOLBAR BUTTONS
========================================== */

.song-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; direction: rtl; }

.song-toolbar-left { display: flex; align-items: center; gap: 8px; margin-right: auto; margin-left: 0; }

/* Consistent appearance for toolbar actions */

.song-toolbar .add-to-book,
.song-toolbar .youtube-trigger,
.song-toolbar .fullscreen-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; min-height: 38px; padding: 0 12px; background: #fafbfe; color: #495574; border: 1px solid #e1e5ee; border-radius: 9px; box-shadow: none; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }

.song-toolbar .fullscreen-trigger { width: 38px; padding: 0; }

    .song-toolbar .add-to-book:hover,
    .song-toolbar .youtube-trigger:hover,
    .song-toolbar .fullscreen-trigger:hover { background: #f0f3fb; color: #39489a; border-color: #cdd6ec; box-shadow: none; }

/* Icons */

.song-toolbar-left .add-to-book i,
.song-toolbar-left .youtube-trigger i,
.song-toolbar-left .fullscreen-trigger i { font-size: 15px; line-height: 1; }

/* Compact, matching layout switch */

.song-toolbar .lyrics-layout-switch { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 3px; border: 1px solid #e1e5ee; background: #fafbfe; border-radius: 9px; flex-shrink: 0; }

    .song-toolbar .lyrics-layout-switch button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; background: transparent; border: 0; border-radius: 6px; color: #858b9b; font-size: 14px; line-height: 1; box-shadow: none; cursor: pointer; }

        .song-toolbar .lyrics-layout-switch button:hover { background: #eef1f9; color: #39489a; }

        .song-toolbar .lyrics-layout-switch button.active { background: #e8ecfa; color: #39489a; }

/* Related songs: same height and styling */

.song-toolbar .related-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 13px; background: #fafbfe; border: 1px solid #e1e5ee; border-radius: 9px; color: #667085; box-shadow: none; font-size: 12px; }

/* Smaller screens */

@media (max-width: 767px) {
    .song-toolbar { flex-wrap: wrap; gap: 10px; }

    .song-toolbar-left { flex-wrap: wrap; gap: 6px; }

    .song-toolbar .add-to-book,
    .song-toolbar .youtube-trigger { padding: 0 9px; }
}


/* Fullscreen: one column */

.tm-slide .tm-slide-lyrics[data-layout="one"]
.song-verse-lines { display: grid; grid-template-columns: minmax(0, 1fr); }

/* Fullscreen: two columns */

.tm-slide .tm-slide-lyrics[data-layout="two"]
.song-verse-lines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; direction: rtl; }

/* Ensure each line fits its column */

.tm-slide .song-verse-line { min-width: 0; text-align: center; overflow-wrap: break-word; }

/* ==========================================
   YOUTUBE VIDEO LIGHTBOX
========================================== */

.tm-youtube-lightbox { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(12, 17, 32, 0.88); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility .25s ease; }

    .tm-youtube-lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }

.tm-youtube-content { position: relative; width: 100%; max-width: 1000px; }

.tm-youtube-video { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; border-radius: 12px; box-shadow: 0 20px 70px rgba(0,0,0,.35); }

    .tm-youtube-video iframe { display: block; width: 100%; height: 100%; border: 0; }

.tm-youtube-close { position: absolute; right: 0; top: -52px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; transition: background .2s ease; }

    .tm-youtube-close:hover { background: rgba(255,255,255,.25); }

body.tm-youtube-open { overflow: hidden; }

@media (max-width: 767px) {
    .tm-youtube-lightbox { padding: 15px; }

    .tm-youtube-video { border-radius: 8px; }

    .tm-youtube-close { top: -48px; }
}
