/* ==========================================================================
   TahrirPress AI Newsroom — Frontend Bilingual /en/ & Switcher Styles
   Theme-agnostic + Jannah Magazine Grid Compatibility
   ========================================================================== */

/* 1. Smart Hybrid Language Switcher (Bottom-Left) */
#tpn-lang-switcher {
    position: fixed;
    bottom: 22px;
    left: 22px;
    z-index: 99990;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#tpn-lang-switcher .tpn-els-globe {
    color: #94a3b8;
    margin: 0 4px 0 6px;
    flex-shrink: 0;
}

#tpn-lang-switcher .tpn-els-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #e2e8f0;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

#tpn-lang-switcher .tpn-els-badge {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.1;
    background: rgba(255, 255, 255, 0.16);
    color: #f8fafc;
}

#tpn-lang-switcher .tpn-els-item:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

#tpn-lang-switcher .tpn-els-active {
    background: #dc2626;
    color: #ffffff;
    cursor: default;
}

#tpn-lang-switcher .tpn-els-active:hover {
    background: #dc2626;
}

#tpn-lang-switcher .tpn-els-active .tpn-els-badge {
    background: rgba(255, 255, 255, 0.26);
    color: #ffffff;
}

/* Keep scroll-to-top controls clear of bottom-left / bottom-right floating widgets */
#go-to-top,
.go-to-top {
    bottom: 82px !important;
}

/* Instant English Reader Notice & Google Translate Popup/Banner Suppression */
#tpn-instant-notice {
    display: none;
    position: sticky;
    top: 0;
    z-index: 99991;
    background: #1e293b;
    color: #f8fafc;
    padding: 9px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#tpn-instant-notice a {
    color: #fca5a5;
    text-decoration: underline;
    margin-left: 8px;
}

#goog-gt-tt,
[id^="goog-gt-"],
.goog-te-balloon-frame,
.goog-te-banner-frame,
.VIpgJd-suEOdc,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.goog-te-SkipTranslate,
iframe.skiptranslate,
body > .skiptranslate {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}

.goog-text-highlight {
    background: transparent !important;
    box-shadow: none !important;
}

html,
body {
    top: 0 !important;
}

body.translated-ltr,
body.translated-rtl {
    position: static !important;
}

/* 2. Auto Internal Links Mesh */
.tpn-auto-links {
    margin: 25px 0;
    padding: 15px 20px;
    background: #f9fafb;
    border-radius: 6px;
}

.tpn-auto-links-ar {
    border-right: 4px solid #d32f2f;
    direction: rtl;
    text-align: right;
}

.tpn-auto-links-en {
    border-left: 4px solid #d32f2f;
    direction: ltr;
    text-align: left;
}

.tpn-auto-links h4 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.tpn-auto-links ul {
    margin: 0;
    list-style-type: disc;
}

.tpn-auto-links-ar ul {
    padding-right: 20px;
    padding-left: 0;
}

.tpn-auto-links-en ul {
    padding-left: 20px;
    padding-right: 0;
}

.tpn-auto-links li {
    margin-bottom: 6px;
}

.tpn-auto-links li a {
    color: #d32f2f;
    font-weight: 600;
    text-decoration: none;
}

.tpn-auto-links li a:hover {
    text-decoration: underline;
}

/* 3. LTR Overrides on /en/ Routes (Jannah + Theme-Agnostic) */
html[dir="ltr"],
body.tpn-en-ltr {
    direction: ltr !important;
    text-align: left !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

body.tpn-en-ltr .tie-alignleft {
    float: left !important;
}

body.tpn-en-ltr .tie-alignright {
    float: right !important;
}

body.tpn-en-ltr #top-nav .breaking-title {
    float: left;
    margin-right: 12px;
    margin-left: 0;
}

body.tpn-en-ltr #top-nav .breaking-news {
    text-align: left;
}

body.tpn-en-ltr #top-nav .breaking:not(:has(li.news-item)) {
    display: none !important;
}

body.tpn-en-ltr #main-nav .menu > li {
    float: left !important;
}

body.tpn-en-ltr #main-nav .menu > li.tpn-nav-ar {
    float: right !important;
}

body.tpn-en-ltr aside.sidebar,
body.tpn-en-ltr .widget-area,
body.tpn-en-ltr .read-next-slider-50,
body.tpn-en-ltr #related-posts,
body.tpn-en-ltr .post-navigation {
    display: none !important;
}

body.tpn-en-ltr .main-content.tie-col-md-8,
body.tpn-en-ltr #primary.content-area,
body.tpn-en-ltr main.site-main {
    width: 100% !important;
    max-width: 960px;
    margin: 0 auto !important;
    float: none !important;
}

body.tpn-en-ltr.tpn-en-hub .main-content.tie-col-md-8,
body.tpn-en-ltr.tpn-en-hub #primary.content-area,
body.tpn-en-ltr.tpn-en-hub main.site-main {
    max-width: 1200px !important;
}

body.tpn-en-ltr.tpn-en-hub #breadcrumb,
body.tpn-en-ltr.tpn-en-hub .breadcrumbs {
    display: none !important;
}

body.tpn-en-ltr.tpn-en-hub article#the-post,
body.tpn-en-ltr.tpn-en-hub .site-main > article.page {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.tpn-en-ltr.tpn-en-hub article#the-post > .entry-content,
body.tpn-en-ltr.tpn-en-hub .site-main > article.page > .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Visually hidden accessible H1 on /en/ Hub */
body.tpn-en-ltr.tpn-en-hub article#the-post > .entry-header-outer,
body.tpn-en-ltr.tpn-en-hub .site-main > article.page > .entry-header,
body.tpn-en-ltr.tpn-en-hub h1.wp-block-post-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.tpn-en-ltr .entry-content,
body.tpn-en-ltr .entry-header,
body.tpn-en-ltr #breadcrumb {
    direction: ltr !important;
    text-align: left !important;
}

body.tpn-en-ltr .entry-content ul,
body.tpn-en-ltr .entry-content ol {
    padding-left: 24px !important;
    padding-right: 0 !important;
}

body.tpn-en-ltr .entry-content blockquote {
    border-left: 4px solid #1d4ed8 !important;
    border-right: none !important;
    padding: 14px 18px !important;
    text-align: left !important;
}

body.tpn-en-ltr #footer .copyright-text {
    float: left !important;
    text-align: left !important;
}

body.tpn-en-ltr #footer .footer-menu {
    float: right !important;
}

body.tpn-en-ltr #footer .footer-menu ul li {
    float: left !important;
    margin-left: 16px;
    margin-right: 0;
}

/* 4. English Newspaper Magazine Grid Layout (/en/) */
.tpn-en-portal {
    direction: ltr;
    text-align: left;
    margin: 6px 0 36px;
}

.tpn-en-newspaper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
    align-items: start;
}

.tpn-en-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.tpn-en-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid #b91c1c;
    border-radius: 6px;
    padding: 18px 20px 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.tpn-en-block-navy {
    border-top-color: #1d4ed8;
}

.tpn-en-block-amber {
    border-top-color: #b45309;
}

.tpn-en-block-teal {
    border-top-color: #0f766e;
}

.tpn-en-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.tpn-en-block-header h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.tpn-en-block-header h2 a {
    color: inherit;
    text-decoration: none;
}

.tpn-en-block-header h2 a:hover {
    color: #b91c1c;
}

.tpn-en-view-all {
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.tpn-en-view-all:hover {
    text-decoration: underline;
}

.tpn-en-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    background: #b91c1c;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none !important;
    line-height: 1.2;
}

.tpn-en-badge-navy {
    background: #1d4ed8;
}

.tpn-en-badge-amber {
    background: #b45309;
}

.tpn-en-badge-teal {
    background: #0f766e;
}

/* Block 1: Hero Featured Block */
.tpn-en-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.tpn-en-hero-lead {
    position: relative;
    display: block;
    border-radius: 6px;
    overflow: hidden;
    min-height: 360px;
    background: #0f172a;
}

.tpn-en-hero-lead img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.tpn-en-hero-lead:hover img {
    transform: scale(1.03);
}

.tpn-en-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 25%, rgba(15, 23, 42, 0.92) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    pointer-events: none;
}

.tpn-en-hero-overlay a {
    pointer-events: auto;
}

.tpn-en-hero-imglink {
    display: block;
    width: 100%;
    height: 100%;
}

.tpn-en-hero-overlay h3 {
    margin: 10px 0 8px;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
}

.tpn-en-hero-overlay h3 a {
    color: #ffffff;
    text-decoration: none;
}

.tpn-en-hero-overlay h3 a:hover {
    color: #fecaca;
}

.tpn-en-hero-meta {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 600;
}

.tpn-en-hero-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: space-between;
}

.tpn-en-mini-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.tpn-en-mini-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.tpn-en-mini-thumb {
    flex: 0 0 112px;
    aspect-ratio: 16 / 10;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
    display: block;
}

.tpn-en-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpn-en-mini-body {
    flex: 1;
    min-width: 0;
}

.tpn-en-mini-body h3 {
    margin: 4px 0 4px;
    font-size: 14px;
    line-height: 1.38;
    font-weight: 700;
}

.tpn-en-mini-body h3 a {
    color: #0f172a;
    text-decoration: none;
}

.tpn-en-mini-body h3 a:hover {
    color: #b91c1c;
}

.tpn-en-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Blocks 2 & 3: Half-Box Dual Row */
.tpn-en-half-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.tpn-en-half-lead-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f1f5f9;
}

.tpn-en-half-lead-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpn-en-half-lead-thumb .tpn-en-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.tpn-en-lead-title {
    margin: 0 0 6px;
    font-size: 17px;
    line-height: 1.36;
    font-weight: 800;
}

.tpn-en-lead-title a {
    color: #0f172a;
    text-decoration: none;
}

.tpn-en-lead-title a:hover {
    color: #b91c1c;
}

.tpn-en-excerpt {
    margin: 8px 0 14px;
    font-size: 13.5px;
    line-height: 1.58;
    color: #475569;
}

.tpn-en-sublist {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Full-Width Two-Column Cards (Tourism, Business, Archive Pages) */
.tpn-en-two-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.tpn-en-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tpn-en-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
}

.tpn-en-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpn-en-card-thumb .tpn-en-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.tpn-en-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tpn-en-card-title {
    margin: 4px 0 8px;
    font-size: 16.5px;
    line-height: 1.38;
    font-weight: 800;
}

.tpn-en-card-title a {
    color: #0f172a;
    text-decoration: none;
}

.tpn-en-card-title a:hover {
    color: #b91c1c;
}

.tpn-en-card-more {
    font-size: 12.5px;
    font-weight: 700;
    color: #b91c1c;
    text-decoration: none;
    margin-top: auto;
}

/* Block 5: Dark-Skin Sports Showcase */
.tpn-en-dark-block {
    background: #131824;
    border: 1px solid #1e293b;
    border-top: 3px solid #dc2626;
    border-radius: 6px;
    padding: 20px;
    color: #f8fafc;
}

.tpn-en-dark-block .tpn-en-block-header {
    border-bottom-color: #293245;
}

.tpn-en-dark-block .tpn-en-block-header h2,
.tpn-en-dark-block .tpn-en-block-header h2 a {
    color: #ffffff;
}

.tpn-en-dark-block .tpn-en-view-all {
    color: #fca5a5;
}

.tpn-en-dark-block .tpn-en-card {
    background: #1b2232;
    border-color: #2c364d;
}

.tpn-en-dark-block .tpn-en-card-title a {
    color: #ffffff;
}

.tpn-en-dark-block .tpn-en-card-title a:hover {
    color: #fca5a5;
}

.tpn-en-dark-block .tpn-en-date {
    color: #94a3b8;
}

.tpn-en-dark-block .tpn-en-excerpt {
    color: #cbd5e1;
}

.tpn-en-dark-block .tpn-en-card-more {
    color: #fca5a5;
}

/* Pagination Bar for /en/page/N/ */
.tpn-en-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
}

.tpn-en-pagination a {
    color: #b91c1c;
    text-decoration: none;
}

.tpn-en-pagination a:hover {
    text-decoration: underline;
}

.tpn-en-pagination .tpn-en-page-status {
    color: #475569;
    font-weight: 600;
}

.tpn-en-empty {
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
}

/* Sticky Right Sidebar */
.tpn-en-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 24px;
}

.tpn-en-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid #b91c1c;
    border-radius: 6px;
    padding: 16px 18px 18px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.tpn-en-widget-title {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tpn-en-trending-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tpn-en-trending-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.tpn-en-trending-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.tpn-en-trending-thumb {
    position: relative;
    flex: 0 0 98px;
    aspect-ratio: 16 / 10;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
    display: block;
}

.tpn-en-trending-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpn-en-rank-num {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.tpn-en-trending-body h3 {
    margin: 0 0 4px;
    font-size: 13.5px;
    line-height: 1.38;
    font-weight: 700;
}

.tpn-en-trending-body h3 a {
    color: #0f172a;
    text-decoration: none;
}

.tpn-en-trending-body h3 a:hover {
    color: #b91c1c;
}

.tpn-en-desks-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tpn-en-desks-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #b91c1c;
    border-radius: 4px;
    color: #0f172a;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.tpn-en-desks-list a:hover {
    background: #fee2e2;
    color: #991b1b;
}

.tpn-en-desks-count {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
}

.tpn-en-about-widget p {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}

.tpn-en-sovereign-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tpn-en-sovereign-links a {
    padding: 5px 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.tpn-en-sovereign-links a:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .tpn-en-newspaper {
        grid-template-columns: 1fr;
    }

    .tpn-en-sidebar {
        position: static;
    }
}

@media (max-width: 767px) {
    .tpn-en-hero-grid,
    .tpn-en-half-row,
    .tpn-en-two-cards {
        grid-template-columns: 1fr;
    }

    .tpn-en-hero-lead,
    .tpn-en-hero-lead img {
        min-height: 260px;
    }
}
