/*
Theme Name: LEB9 News
Theme URI: https://example.com/
Author: LEB9
Description: Custom RTL Arabic news theme for LEB9 - Lebanese Events Bulletin.
Version: 1.4.0
License: GPL-2.0-or-later
Text Domain: leb9
*/

:root {
    --green: #062d20;
    --green2: #0b4a35;
    --gold: #d8ad52;
    --gold2: #f0cf7a;
    --white: #fff;
    --ink: #14211c;
    --muted: #6d7772;
    --bg: #f5f6f4;
    --line: #e4e8e5;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Tahoma, Arial, "Noto Sans Arabic", sans-serif;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input {
    font: inherit;
}

.container {
    width: min(calc(100% - 32px), var(--max));
    margin: auto;
}

/* HEADER */

.site-header {
    background: var(--green);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px #0002;
}

.header-top {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    width: 190px;
    max-height: 70px;
    object-fit: contain;
}

.header-side {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-text {
    text-align: right;
}

.brand-title {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .4px;
}

.brand-sub {
    font-size: 11px;
    color: var(--gold2);
    letter-spacing: 1.2px;
    white-space: nowrap;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff14;
    color: #fff;
    flex: none;
    transition: .2s;
}

.social-icon svg {
    width: 17px;
    height: 17px;
}

.social-icon:hover {
    background: var(--social-color, var(--gold));
    color: #fff;
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #ffffff44;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
}

/* NAVIGATION */

.main-nav {
    border-top: 1px solid #ffffff18;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav a {
    display: block;
    padding: 10px 14px;
    color: #fff;
    font-weight: 700;
    border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    border-color: var(--gold);
    background: #ffffff08;
}

/* BREAKING NEWS TICKER */

.breaking {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.breaking-inner {
    display: flex;
    align-items: center;
    min-height: 44px;
    overflow: hidden;
}

.breaking-label {
    background: var(--gold);
    color: #182018;
    font-weight: 900;
    padding: 6px 14px;
    white-space: nowrap;
    border-radius: 0 5px 5px 0;
    flex: none;
}

.ticker {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    direction: rtl;
}

.ticker-track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: 32px;
    animation: ticker 20s linear infinite;
    padding-right: 25px;
    white-space: nowrap;
    will-change: transform;
}

.ticker-track a {
    flex: none;
    font-size: 14px;
    font-weight: 700;
}

.ticker-track a:hover {
    color: var(--green2);
}

.ticker-track span {
    color: var(--gold);
    flex: none;
}

.ticker:hover .ticker-track {
    animation-play-state: paused;
}

@keyframes ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(50%);
    }
}

/* URGENT ALERT */

.urgent-alert {
    background: linear-gradient(135deg, #b3261e, #7a1a15);
    color: #fff;
    overflow: hidden;
    animation: leb9-urgent-in .35s ease;
}

.urgent-alert-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 46px;
    padding: 9px 0;
}

.urgent-alert-badge {
    background: #fff;
    color: #b3261e;
    font-weight: 900;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 5px;
    white-space: nowrap;
    flex: none;
    animation: leb9-urgent-pulse 1.4s infinite;
}

.urgent-alert-text {
    font-weight: 700;
    flex: 1;
    line-height: 1.5;
}

.urgent-alert-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    flex: none;
    opacity: .85;
}

.urgent-alert-close:hover {
    opacity: 1;
}

.urgent-alert.leb9-hide {
    animation: leb9-urgent-out .35s ease forwards;
}

@keyframes leb9-urgent-in {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes leb9-urgent-out {
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes leb9-urgent-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .55;
    }
}

/* HOMEPAGE HERO */

.hero {
    padding: 26px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 18px;
}

.hero-grid.no-hero {
    grid-template-columns: 1fr;
}

.hero-grid.no-hero .side-news {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
}

.hero-card {
    position: relative;
    min-height: 390px;
    background: #0a261d;
    border-radius: 14px;
    overflow: hidden;
    color: #fff;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .8;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 25%, #000d 100%);
    display: flex;
    align-items: flex-end;
    padding: 26px;
}

.hero-overlay h1 {
    font-size: clamp(25px, 3vw, 42px);
    line-height: 1.2;
    margin: 8px 0;
}

.meta {
    font-size: 13px;
    color: #c9d0cc;
}

/* SIDEBAR AND LATEST NEWS */

.side-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hourly-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.hourly-box-head {
    background: var(--green);
    color: #f0cf7a;
    font-weight: 900;
    font-size: 14px;
    padding: 10px 14px;
    border-right: 5px solid var(--gold);
}

.hourly-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hourly-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
}

.hourly-item:last-child {
    border-bottom: none;
}

.hourly-time {
    color: var(--green2);
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
    direction: ltr;
}

.hourly-item .hourly-text {
    font-size: 14px;
    line-height: 1.5;
}

.side-news {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    gap: 18px;
}

.side-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.side-card img {
    width: 150px;
    height: 100%;
    object-fit: cover;
}

.side-card-body {
    padding: 12px 12px 12px 0;
}

.side-card h2 {
    font-size: 18px;
    line-height: 1.35;
    margin: 3px 0 8px;
}

/* NEWS SECTIONS */

.section {
    padding: 10px 0 28px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 5px solid var(--gold);
    padding: 0 12px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    font-size: 25px;
}

.more {
    color: var(--green2);
    font-weight: 800;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.news-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: .2s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px #0000000b;
}

.news-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.news-card-body {
    padding: 13px;
}

.news-card h3 {
    font-size: 18px;
    line-height: 1.4;
    margin: 5px 0 7px;
}

.category-pill {
    font-size: 11px;
    color: var(--green2);
    font-weight: 900;
}

.empty {
    background: #fff;
    border: 1px dashed #ccd4cf;
    padding: 22px;
    border-radius: 10px;
    color: var(--muted);
}

/* ARTICLE PAGES */

.content-area {
    padding: 30px 0;
}

.single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.article,
.sidebar-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
}

.article h1 {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.25;
    margin: 5px 0 12px;
}

.article-thumb {
    width: 100%;
    max-height: 540px;
    object-fit: cover;
    border-radius: 10px;
    margin: 15px 0;
}

.article-content {
    font-size: 18px;
}

.article-content p {
    margin: 0 0 18px;
}

.sidebar-box {
    margin-bottom: 18px;
}

.sidebar-box h3 {
    margin-top: 0;
    border-right: 4px solid var(--gold);
    padding-right: 9px;
}

.sidebar-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

/* FOOTER */

.site-footer {
    background: var(--green);
    color: #fff;
    margin-top: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr .8fr;
    gap: 30px;
    padding: 36px 0;
}

.site-footer h3 {
    color: var(--gold2);
    margin-top: 0;
}

.site-footer a {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #ffffff1a;
    padding: 14px 0;
    color: #bfcac4;
    font-size: 13px;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin: 5px 0;
}

.footer-social .social-icons {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.footer-social .social-icon {
    width: 30px;
    height: 30px;
}

.footer-social .social-icon svg {
    width: 15px;
    height: 15px;
}

/* WEATHER */

.weather-box {
    background: linear-gradient(135deg, var(--green), var(--green2));
    color: #fff;
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 22px;
    position: relative;
}

.weather-tile {
    border-right: 1px solid #ffffff2a;
}

.weather-tile:first-child {
    border-right: none;
}

.weather-tile-label {
    font-size: 13px;
    color: #e6ebe8;
    opacity: .9;
    margin-bottom: 6px;
}

.weather-temp {
    font-size: 38px;
    font-weight: 900;
    color: var(--gold2);
}

.weather-temp-sm {
    font-size: 24px;
}

.weather-updated {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #dfe6e2;
    opacity: .8;
    border-top: 1px solid #ffffff2a;
    padding-top: 10px;
    margin-top: 2px;
}

/* TABLET AND MOBILE */

@media (max-width: 850px) {
    .header-top {
        min-height: 72px;
    }

    .brand img {
        width: 145px;
    }

    .brand-title,
    .brand-sub {
        display: none;
    }

    .header-side {
        gap: 10px;
    }

    .social-icons {
        gap: 5px;
    }

    .social-icon {
        width: 28px;
        height: 28px;
    }

    .social-icon svg {
        width: 14px;
        height: 14px;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        display: block;
        padding: 8px 0;
        direction: rtl;
    }

    .main-nav a {
        padding: 9px 12px;
    }

    .hero-grid,
    .single-layout {
        grid-template-columns: 1fr;
    }

    .side-news {
        grid-template-rows: none;
        grid-template-columns: 1fr 1fr;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        row-gap: 24px;
    }

    .footer-social {
        grid-column: 1 / -1;
    }

    .footer-social .social-icons {
        flex-direction: row;
    }

    .weather-box {
        grid-template-columns: 1fr 1fr;
    }

    .urgent-alert-text {
        font-size: 14px;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(calc(100% - 22px), var(--max));
    }

    .side-news,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        min-height: 320px;
    }

    .side-card {
        grid-template-columns: 120px 1fr;
    }

    .side-card img {
        width: 120px;
    }

    .breaking-label {
        font-size: 12px;
        padding: 5px 9px;
    }

    /* Slow ticker on mobile too */
    .ticker-track {
        animation-duration: 20s;
        gap: 24px;
    }

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

    .footer-social {
        grid-column: auto;
    }

    .footer-social .social-icons {
        flex-direction: row;
    }

    .article,
    .sidebar-box {
        padding: 16px;
    }

    .article-content {
        font-size: 17px;
    }

    .brand-text {
        display: none;
    }

    .social-icon {
        width: 26px;
        height: 26px;
    }

    .weather-box {
        grid-template-columns: 1fr;
    }

    .weather-tile {
        border-right: none;
        border-bottom: 1px solid #ffffff2a;
        padding-bottom: 12px;
    }

    .weather-tile:last-of-type {
        border-bottom: none;
    }

    .urgent-alert-inner {
        align-items: flex-start;
        padding: 10px 0;
    }

    .urgent-alert-text {
        font-size: 13px;
    }
}

/* GLOBAL ARABIC RTL LAYOUT */

html[dir="rtl"],
body {
    direction: rtl;
    text-align: right;
}

.main-nav ul,
.header-top,
.breaking-inner,
.section-head {
    direction: rtl;
}

.brand {
    direction: rtl;
}

.side-card {
    direction: rtl;
}

.ticker-track {
    direction: rtl;
}

@media (max-width: 850px) {
    .main-nav ul {
        direction: rtl;
    }
}

/* VIDEO MEDIA PAGE - YOUTUBE SHORTS */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.video-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: .2s;
    padding: 13px;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px #0000000b;
}

.video-card h3 {
    font-size: 18px;
    line-height: 1.4;
    margin: 0 0 10px;
}

.video-embed-wrap {
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding-top: 177.78%;
    border-radius: 8px;
    overflow: hidden;
}

.video-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 560px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-embed-wrap {
        max-width: 100%;
    }
}

/* ACCESSIBILITY: RESPECT REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .ticker-track {
        animation-duration: 160s;
    }

    .urgent-alert,
    .urgent-alert-badge {
        animation: none;
    }
}
