/*
Theme Name: Techno News
Theme URI: https://example.com/techno-news
Author: Techno News
Author URI: https://example.com
Description: قالب مجلة تقنية عربية حديثة وسريعة مع دعم RTL والوضع الليلي.
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 8.0
Text Domain: techno-news
Domain Path: /languages
*/

:root {
  --tn-primary: #2364ff;
  --tn-primary-dark: #1545c4;
  --tn-ink: #0a1733;
  --tn-muted: #64748b;
  --tn-paper: #f7f9fc;
  --tn-surface: #ffffff;
  --tn-border: #e3eaf4;
  --tn-radius: 18px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--tn-ink);
  background: var(--tn-paper);
  font-family: "Cairo", "Tajawal", system-ui, sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
body.tn-dark {
  --tn-ink: #eef4ff;
  --tn-muted: #a7b4c8;
  --tn-paper: #091225;
  --tn-surface: #101d34;
  --tn-border: #24334f;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.tn-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.tn-screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.tn-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--tn-surface) 92%, transparent);
  border-bottom: 1px solid var(--tn-border);
  backdrop-filter: blur(16px);
}
.tn-header__inner {
  min-height: 76px; display: flex; align-items: center; gap: 28px;
}
.tn-brand { display: inline-flex; align-items: center; gap: 10px; margin-inline-end: auto; }
.tn-brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  color: white; background: var(--tn-primary); font-weight: 800;
}
.tn-brand__name { font-size: 1.16rem; font-weight: 900; letter-spacing: -.04em; }
.tn-brand__tagline { color: var(--tn-muted); font-size: .65rem; display: block; line-height: 1; }
.tn-nav ul { display: flex; align-items: center; gap: 22px; list-style: none; padding: 0; margin: 0; }
.tn-nav a { color: var(--tn-muted); font-size: .86rem; font-weight: 700; transition: color .2s ease; }
.tn-nav a:hover, .tn-nav .current-menu-item > a { color: var(--tn-primary); }
.tn-header__actions { display: flex; gap: 8px; }
.tn-icon-button, .tn-menu-button {
  display: inline-grid; place-items: center; border: 1px solid var(--tn-border);
  border-radius: 12px; width: 38px; height: 38px; cursor: pointer;
  color: var(--tn-ink); background: var(--tn-surface); transition: border-color .2s, color .2s;
}
.tn-icon-button:hover, .tn-menu-button:hover { color: var(--tn-primary); border-color: var(--tn-primary); }
.tn-menu-button { display: none; }
.tn-search { display: none; padding: 10px 0 14px; }
.tn-search.is-open { display: block; }
.tn-search form { display: flex; gap: 10px; }
.tn-search input { flex: 1; border: 1px solid var(--tn-border); border-radius: 12px; padding: 11px 14px; color: var(--tn-ink); background: var(--tn-paper); }
.tn-search button, .tn-button {
  border: 0; border-radius: 12px; padding: 10px 16px; color: white;
  background: var(--tn-primary); cursor: pointer; font-weight: 800;
}

.tn-ad {
  min-height: 92px; margin: 24px 0; display: grid; place-items: center;
  color: var(--tn-muted); background: var(--tn-surface); border: 1px dashed var(--tn-border);
  border-radius: var(--tn-radius); text-align: center; font-size: .78rem;
}
.tn-ad small { display: block; opacity: .65; }
.tn-main { padding-bottom: 72px; }
.tn-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr); gap: 18px; }
.tn-hero__lead { min-height: 455px; position: relative; overflow: hidden; border-radius: 22px; background: #091225; color: white; box-shadow: 0 18px 42px rgba(10,23,51,.14); }
.tn-hero__lead-image { position: absolute; inset: 0; display: block; }
.tn-hero__lead img { width: 100%; height: 100%; object-fit: cover; opacity: .78; transition: transform .5s ease, opacity .3s ease; }
.tn-hero__lead:hover img { transform: scale(1.035); opacity: .88; }
.tn-hero__lead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,12,27,.94), transparent 70%); }
.tn-hero__overlay { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(7,19,41,.03) 15%, rgba(7,19,41,.12) 42%, rgba(5,12,27,.92) 100%); pointer-events: none; }
.tn-hero__content { position: absolute; inset: auto 34px 32px; z-index: 1; max-width: 690px; }
.tn-hero__topline { display: flex; align-items: center; gap: 12px; }
.tn-hero__label { padding: 5px 9px; border: 1px solid rgba(255,255,255,.27); border-radius: 999px; color: rgba(255,255,255,.84); background: rgba(7,19,41,.24); font-size: .68rem; backdrop-filter: blur(8px); }
.tn-kicker { color: var(--tn-primary); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.tn-hero__lead .tn-kicker { color: #8eb1ff; }
.tn-hero h1 { margin: 10px 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.25; letter-spacing: -.06em; }
.tn-excerpt { color: var(--tn-muted); margin: 0; }
.tn-hero__lead .tn-excerpt { color: #d1dbea; }
.tn-meta { display: flex; align-items: center; gap: 10px; color: var(--tn-muted); font-size: .75rem; margin-top: 16px; }
.tn-hero__lead .tn-meta { color: #c6d2e2; }
.tn-hero__readmore { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: auto; padding: 7px 10px; border-radius: 8px; color: #08142b; background: var(--tn-primary); font-weight: 900; transition: transform .2s, background .2s; }
.tn-hero__readmore:hover { transform: translateY(-2px); background: #b1c7ff; color: #08142b; }
.tn-hero__side { display: grid; gap: 18px; }
.tn-mini-story { display: grid; grid-template-columns: 118px 1fr; gap: 14px; padding: 12px; background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); }
.tn-mini-story img { width: 118px; height: 104px; object-fit: cover; border-radius: 12px; }
.tn-mini-story h3 { font-size: .98rem; line-height: 1.55; margin: 6px 0 0; }
.tn-mini-story:hover h3, .tn-card:hover h3 { color: var(--tn-primary); }

.tn-section { margin-top: 58px; }
.tn-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tn-section__heading h2 { font-size: 1.55rem; line-height: 1.2; margin: 0; letter-spacing: -.05em; }
.tn-section__heading h2::before { content: ""; display: inline-block; width: 5px; height: 25px; margin-inline-end: 10px; vertical-align: -4px; background: var(--tn-primary); border-radius: 4px; }
.tn-more { color: var(--tn-primary); font-weight: 800; font-size: .82rem; }
.tn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tn-card { overflow: hidden; background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); transition: transform .2s, box-shadow .2s; }
.tn-card:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(18,49,91,.09); }
.tn-card__image { aspect-ratio: 1.55; overflow: hidden; }
.tn-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.tn-card:hover .tn-card__image img { transform: scale(1.04); }
.tn-card__body { padding: 16px; }
.tn-card h3 { margin: 6px 0; font-size: 1.02rem; line-height: 1.6; transition: color .2s; }
.tn-card .tn-excerpt { font-size: .81rem; }
.tn-section--band { padding: 26px; background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: 22px; }
.tn-feature-band { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.tn-feature-band__main { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.tn-feature-band__main img { width: 100%; aspect-ratio: 1.15; object-fit: cover; border-radius: 15px; }
.tn-feature-band__main h3 { font-size: 1.45rem; line-height: 1.45; margin: 8px 0; }
.tn-list { display: grid; gap: 14px; }
.tn-list__item { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; }
.tn-list__item img { width: 92px; height: 76px; border-radius: 12px; object-fit: cover; }
.tn-list__item h3 { margin: 4px 0 0; font-size: .92rem; line-height: 1.5; }
.tn-popular { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tn-popular__item { display: flex; align-items: center; gap: 12px; padding: 13px; background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: 14px; }
.tn-popular__number { color: var(--tn-primary); font-size: 1.35rem; font-weight: 900; width: 28px; }
.tn-popular__item h3 { font-size: .88rem; line-height: 1.5; margin: 0; }
.tn-footer { color: #d8e4fa; padding: 50px 0 20px; background: #071329; }
.tn-footer__grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 32px; }
.tn-footer h2, .tn-footer h3 { color: white; margin: 0 0 14px; }
.tn-footer p, .tn-footer a { color: #99a9c2; font-size: .84rem; }
.tn-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.tn-footer a:hover { color: white; }
.tn-footer__bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 26px; margin-top: 32px; border-top: 1px solid #1d2e4d; color: #8193b1; font-size: .78rem; }
.tn-reading-progress { position: fixed; top: 0; right: 0; z-index: 100; width: 0; height: 3px; background: var(--tn-primary); box-shadow: 0 0 14px rgba(35,100,255,.7); transition: width .15s ease-out; }
.tn-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.tn-article { max-width: 820px; }
.tn-article__header { max-width: 900px; margin-bottom: 26px; }
.tn-article__kicker { display: flex; align-items: center; gap: 8px; color: var(--tn-muted); font-size: .78rem; font-weight: 800; }
.tn-article__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tn-primary); box-shadow: 0 0 0 5px rgba(35,100,255,.12); }
.tn-article h1 { font-size: clamp(2.25rem, 5vw, 4.7rem); line-height: 1.15; letter-spacing: -.08em; margin: 14px 0 14px; }
.tn-article__dek { max-width: 700px; color: var(--tn-muted); font-size: 1.08rem; line-height: 1.9; margin: 0 0 25px; }
.tn-article__byline { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--tn-border); padding-top: 16px; }
.tn-author-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; color: white; background: var(--tn-primary); font-weight: 900; }
.tn-author-copy { display: grid; gap: 2px; font-size: .8rem; }
.tn-author-copy small { color: var(--tn-muted); font-size: .68rem; }
.tn-article__stats { margin-inline-start: auto; color: var(--tn-muted); font-size: .72rem; }
.tn-article__image { overflow: hidden; border-radius: 22px; margin: 0 0 10px; }
.tn-article__image img { width: 100%; max-height: 650px; object-fit: cover; }
.tn-article__image figcaption { display: flex; justify-content: space-between; gap: 15px; padding: 9px 2px 0; color: var(--tn-muted); font-size: .67rem; }
.tn-article__image figcaption span:last-child { direction: ltr; font-size: .6rem; }
.tn-article__content { font-size: 1.08rem; line-height: 2; }
.tn-article__content h2, .tn-article__content h3 { line-height: 1.4; margin-top: 1.7em; }
.tn-article__content a { color: var(--tn-primary); text-decoration: underline; text-underline-offset: 3px; }
.tn-share { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.tn-share a, .tn-share button { border: 1px solid var(--tn-border); background: var(--tn-surface); color: var(--tn-ink); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: .78rem; }
.tn-share a:hover, .tn-share button:hover { color: var(--tn-primary); border-color: var(--tn-primary); }
.tn-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 20px; margin-top: 30px; border-top: 1px solid var(--tn-border); }
.tn-tags__label { color: var(--tn-muted); font-size: .72rem; font-weight: 900; margin-inline-end: 4px; }
.tn-tags a { display: inline-flex; padding: 6px 10px; border: 1px solid var(--tn-border); border-radius: 999px; color: var(--tn-ink); background: var(--tn-surface); font-size: .7rem; transition: color .2s, background .2s, border-color .2s; }
.tn-tags a:hover { color: white; background: var(--tn-primary); border-color: var(--tn-primary); text-decoration: none; }
.tn-article__content blockquote { margin: 2em 0; padding: 18px 22px; border-inline-start: 4px solid var(--tn-primary); color: var(--tn-ink); background: var(--tn-surface); font-size: 1.12rem; font-weight: 800; }
.tn-sidebar { display: grid; align-content: start; gap: 20px; }
.tn-sidebar .tn-ad { margin: 0; }
.tn-breadcrumb { color: var(--tn-muted); font-size: .78rem; margin: 22px 0; }
.tn-breadcrumb a { color: var(--tn-primary); }
.tn-pagination { display: flex; gap: 8px; margin-top: 25px; }
.tn-pagination a, .tn-pagination span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--tn-border); border-radius: 10px; background: var(--tn-surface); font-size: .82rem; }
.tn-pagination .current { color: white; background: var(--tn-primary); border-color: var(--tn-primary); }
.tn-empty { padding: 55px 20px; text-align: center; background: var(--tn-surface); border: 1px solid var(--tn-border); border-radius: var(--tn-radius); }

@media (max-width: 900px) {
  .tn-nav { display: none; position: absolute; top: 76px; inset-inline: 0; padding: 12px 20px 18px; background: var(--tn-surface); border-bottom: 1px solid var(--tn-border); }
  .tn-nav.is-open { display: block; }
  .tn-nav ul { align-items: stretch; flex-direction: column; gap: 0; }
  .tn-nav a { display: block; padding: 10px 0; }
  .tn-menu-button { display: inline-grid; }
  .tn-hero { grid-template-columns: 1fr; }
  .tn-hero__lead { min-height: 420px; }
  .tn-footer__grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .tn-footer__grid > :first-child { grid-column: 1 / -1; }
  .tn-article-layout { grid-template-columns: 1fr; }
  .tn-sidebar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .tn-container { width: min(100% - 28px, 1180px); }
  .tn-header__inner { min-height: 66px; gap: 8px; }
  .tn-brand__tagline { display: none; }
  .tn-hero__lead { min-height: 390px; }
  .tn-hero__content { inset-inline: 20px; bottom: 22px; }
  .tn-hero h1 { font-size: 1.85rem; }
  .tn-hero__readmore { padding: 6px 8px; font-size: .65rem; }
  .tn-grid, .tn-popular, .tn-sidebar { grid-template-columns: 1fr; }
  .tn-feature-band, .tn-feature-band__main { grid-template-columns: 1fr; }
  .tn-footer__grid { grid-template-columns: 1fr 1fr; gap: 24px 14px; }
  .tn-footer__grid > :first-child { grid-column: 1 / -1; }
  .tn-footer__bottom { flex-direction: column; }
  .tn-ad { min-height: 74px; margin: 16px 0; }
  .tn-article h1 { font-size: 2.45rem; }
  .tn-article__dek { font-size: .95rem; }
  .tn-article__byline { align-items: flex-start; flex-wrap: wrap; }
  .tn-article__stats { width: 100%; margin-inline-start: 49px; }
  .tn-article__image { border-radius: 15px; }
  .tn-article__image img { max-height: 430px; }
  .tn-article__image figcaption { align-items: flex-start; flex-direction: column; gap: 3px; }
  .tn-share a, .tn-share button { flex: 1; text-align: center; }
  .tn-article__content { font-size: 1rem; }
}