@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Beiruti:wght@200..900&family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&display=swap');
/* ROOT */
:root {
    --bg: #ffffff;
    --text: #111111;
    --dark: #3a3a3a;
    --muted: #7a7a7a;
    --line: #eeeeee;
    --container: 1200px;
    --small: 0.8rem;
    --normal: 1rem;
    --medium: 1.2rem;
    --big: 1.4rem;
    --large: 1.6rem;
    --huge: 2rem;
}

/* RESET */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Newsreader", serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--normal);
}

img.icon {
  width: 38px;
  display: inline;
  padding-right: 14px;
}

.subtitle {
    padding-left: 42px;
    color: #999999;
}

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

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-block {
    display:inline-block;
    padding:12px 16px;
    background:#111;
    color:#fff;
    border-radius:6px;
    text-decoration:none;
}

/* LAYOUT */
.page {
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px 18px 60px;
}

/* HEADER */
.topbar {
    margin-bottom: 24px;
    border-bottom: solid 1px #efefef;
    padding-bottom: 3px;
    margin: 1rem 0px;
}

.brand {
    font-size: 2.7rem;
    font-weight: 800;
    margin-bottom: 27px;
    color: #353E43;
    text-align: center;
}

.brand .brand-text {
  margin-top: 0.2rem;
  min-height: 62px;
  display: inline-block;
}

/* GRID — CORE STRUCTURE */
.feed-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

/* TABLET */
@media (min-width: 700px) {
    .feed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* DESKTOP */
@media (min-width: 1024px) {
    .feed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* CARD */
.story-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-bottom: solid 1px #eeeeee;
    padding-bottom: 21px;
}

.story-card:hover {
    transform: translateY(-3px);
}

/* IMAGE */
.story-media {
    height: 180px;
    background: #f3f3f3;
    overflow: hidden;
}

/* CONTENT */
.story-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* SOURCE */
.kicker {
    font-size: var(--small);
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

/* TITLE */
.story-title {
    font-size: var(--huge);
    font-weight: 700;
    line-height: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;


}

/* EXCERPT (optional but controlled) */
.story-excerpt {
    font-size: var(--big);
    color: var(--dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0px;
}



.story-excerpt {
    margin-top: 0;
}

.audio-generate-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 0px;
    font-size: var(--small);
    cursor: pointer;
    background: transparent;
    border: none;
}

.audio-generate-btn:hover {
    color: #666666;
}

.audio-loading {
    opacity: 0.6;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.audio-loading {
    font-size: var(--small);
    opacity: 0.6;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

ul {
    padding: 0px;
    margin: 0px;
}

li::marker {
    color: var(--muted);
    font-size: 1.4rem;
}

.summary {
    font-size: var(--huge);
    line-height: 2.2rem;
}

 .summary-ai {
    font-size: var(--big);
    line-height: 1.8rem;
}

.summary ul {
    margin-left: 1.6rem;
}

.summary .bold {
    margin-bottom: 1rem;
    color: var(--muted);
}

/* META */
.meta {
    font-size: var(--small);
    color: var(--muted);
    padding-top: 0.3rem;
}


.speaker-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speaker {
    width: 21px;
    flex-shrink: 0;
}

/* ADMIN ACTIONS (CRITICAL — preserved but subtle) */
.story-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
}

/* BUTTONS */
.action-btn {
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s ease;
}

.action-btn:hover {
    background: rgba(0,0,0,0.9);
}

.story-read-summary {
    margin-top: 10px;
}

.read-summary-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

.read-summary-link:hover {
    color: #000;
}

.ai-icon {
    width: 18px;
    height: 18px;
    display: inline;
}

.back {
    font-size: 27px;
}

/* MOBILE TIGHTENING */
@media (max-width: 480px) {
    .story-media {
        height: 160px;
    }

    .brand {
        margin-bottom: 54px;
    }
}


.lang-nav {
    display: flex;
    gap: 8px;
}

.lang-nav a {
    text-decoration: none;
    font-size: var(--medium);
    opacity: 0.6;
}

.lang-nav a.active {
    opacity: 1;
}



/* -----------------------------------------------------
 * Topic chips (dynamic category bar)
 * ----------------------------------------------------- */
.topic-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 16px;
    margin: 0 0 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.topic-bar::-webkit-scrollbar {
    height: 4px;
}

.topic-bar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.topic-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: var(--small);
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    color: #000000;
}

.topic-chip:hover {
    background: rgba(255,255,255,0.12);
    color: #333;
}

.topic-chip.active {
    border: 1px solid #d0021b;
    border-radius: 4px;
    background-color: #e7131a;
    font-weight: 600;
    color: #ffffff;
}

.empty-state {
    padding: 40px 16px;
    text-align: center;
    color: rgba(255,255,255,0.6);
}



/* -----------------------------------------------------
 * Daily digest banner
 * ----------------------------------------------------- */
.digest-banner {
    position: relative;
    padding: 16px 44px 16px 20px;
    margin: 12px 16px 20px 16px;
    background: linear-gradient(135deg, rgba(241,196,15,0.10), rgba(241,196,15,0.04));
    border: 1px solid rgba(241,196,15,0.25);
    border-radius: 8px;
}

.digest-text {
    margin: 0;
    font-size: var(--big);
    line-height: 1.6;
}

.digest-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.digest-close:hover {
    background: rgba(255,255,255,0.08);
    color: #000;
}

.digest-banner[hidden] {
    display: none;
}

.ku-nav {
  font-size: var(--medium) !important;
  margin-top: -0.34rem;
}

.ku {
      font-family: "Beiruti", sans-serif;
      font-optical-sizing: auto;
      font-weight: normal;
      font-style: normal;
    }


.story-excerpt {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;        /* show max 3 lines */
    -webkit-box-orient: vertical;
    word-break: break-word;        /* don't let long URLs break the layout */
}

/* -----------------------------------------------------
 * Save button + saved page styling
 * ----------------------------------------------------- */
.save-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    font-weight: bold;
}

.save-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.05);
}

.save-btn.is-saved {
    color: #f1c40f;
}

.save-btn.is-saved:hover {
    color: #f39c12;
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.saved-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-right: 16px;
    font-size: 14px;
}

.saved-link:hover {
    color: #fff;
}

.saved-section {
    margin: 28px 16px 12px;
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    font-weight: 500;
}

.saved-archive-heading {
    margin-top: 48px;
    color: rgba(255,255,255,0.5);
}

.feed-grid-archive .story-card {
    opacity: 0.65;
}

.feed-grid-archive .story-card:hover {
    opacity: 1;
}

.empty-state {
    padding: 60px 16px;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* RTL adjustment for Kurdish/Arabic */
html[lang="ku"], html[lang="ar"] {

    body, .ku {
      font-family: "Beiruti", sans-serif;
      font-optical-sizing: auto;
      font-weight: normal;
      font-style: normal;
    }


    section#feed {
        text-align: left;
        direction: rtl;
    }

    .brand {
        font-weight: bold;
    }


    .page.ku article .story-excerpt, .page.ku article .story-title, .page.ku .story-title, .page.ku .summary, .digest-text {
        text-align: right;
        direction: rtl;
    }


    .digest-banner,
    .digest-banner {
        direction: rtl;
        text-align: right;
        padding: 16px 20px 16px 44px;
    }

    .digest-close,
    .digest-close {
        right: auto;
        left: 8px;
    }

    nav, div.kicker, .summary-ai, .en-nav {
       font-family: "Newsreader", serif; 
    }
    
    .page.ku article .story-excerpt {
      font-family: "IBM Plex Sans Arabic", sans-serif;
    }

    .brand {
        font-size: 3.2rem;
    }
    .brand .brand-text {
        margin-top: 0rem;
    }
}

/* Digest banner — collapsed by default */
.digest-banner {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 44px 12px 16px;
    margin: 12px 16px;
    color: var(--dark);
    line-height: 1.5;
}

.digest-banner.is-collapsed .digest-text {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.digest-banner:not(.is-collapsed) .digest-text {
    margin: 0 0 8px 0;
}

.digest-toggle {
    background: transparent;
    border: 0;
    color: var(--dark);
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
}

.digest-toggle:hover {
    color: var(--text);
}

.digest-banner.is-collapsed .digest-toggle-less,
.digest-banner:not(.is-collapsed) .digest-toggle-more {
    display: none;
}

.digest-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.4);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.digest-close:hover {
    color: rgba(255,255,255,0.9);
}