/*
Theme Name: جريدة هرم مصر — Child
Theme URI: https://harammissr.com/
Description: تطوير آمن ومتجاوب لقالب جريدة هرم مصر فوق القالب المنشور harm-misr.
Author: Harm Misr
Template: harm-misr
Version: 1.0.0
Text Domain: harm-misr-child
*/

:root {
  --hmc-primary: #0b7775;
  --hmc-primary-dark: #075453;
  --hmc-secondary: #102a43;
  --hmc-accent: #d7a746;
  --hmc-text: #14253f;
  --hmc-muted: #697586;
  --hmc-paper: #f5f7f9;
  --hmc-surface: #fff;
  --hmc-border: #e3e8ee;
  --hmc-radius: 14px;
  --hmc-shadow: 0 12px 32px rgba(16, 42, 67, .08);
  --hmc-container: 1240px;
}

html { overflow-x: hidden; }
body {
  color: var(--hmc-text);
  background: var(--hmc-paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease; }
.hmc-container { width: min(var(--hmc-container), calc(100% - 32px)); margin-inline: auto; }
.hmc-topbar { padding: 8px 0; background: var(--hmc-secondary); color: rgba(255,255,255,.76); font-size: 12px; }
.hmc-topbar .hmc-container { display: flex; justify-content: space-between; gap: 16px; }
.hmc-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--hmc-border); backdrop-filter: blur(10px); }
.hmc-header-inner { display: flex; align-items: center; gap: 22px; min-height: 80px; }
.hmc-brand { flex: 0 0 auto; }
.hmc-brand a { display: inline-flex; flex-direction: column; color: var(--hmc-secondary); line-height: 1.2; }
.hmc-brand strong { font-size: 24px; }
.hmc-brand small { margin-top: 5px; color: var(--hmc-primary); font-size: 11px; font-weight: 800; }
.hmc-brand .custom-logo-link { display: block; }
.hmc-brand .custom-logo { max-width: 220px; max-height: 60px; width: auto; }
.hmc-brand-logo { display: block !important; }
.hmc-brand-logo img { display: block; width: auto; max-width: 220px; height: auto; max-height: 64px; object-fit: contain; }
.hmc-nav { flex: 1 1 auto; }
.hmc-nav ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.hmc-nav a { display: block; padding: 10px 0; color: var(--hmc-secondary); font-size: 14px; font-weight: 800; }
.hmc-nav a:hover, .hmc-nav .current-menu-item > a { color: var(--hmc-primary); }
.hmc-menu-toggle, .hmc-search-toggle { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--hmc-border); border-radius: 8px; background: #fff; color: var(--hmc-secondary); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.hmc-menu-toggle { display: none; }
.hmc-search-toggle:hover, .hmc-menu-toggle:hover { border-color: var(--hmc-primary); color: var(--hmc-primary); }
.hmc-footer { margin-top: 30px; background: var(--hmc-secondary); color: rgba(255,255,255,.76); }
.hmc-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; padding-block: 42px; }
.hmc-footer h2 { margin: 0 0 12px; color: #fff; font-size: 18px; }
.hmc-footer p, .hmc-footer li { font-size: 14px; line-height: 1.8; }
.hmc-footer ul { margin: 0; padding: 0; list-style: none; }
.hmc-footer a:hover { color: var(--hmc-accent); }
.hmc-footer-bottom { padding-block: 15px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.6); font-size: 12px; }
.hmc-section { padding-block: clamp(28px, 4vw, 54px); }
.hmc-section + .hmc-section { padding-top: 0; }
.hmc-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.hmc-section-heading h2 { margin: 0; color: var(--hmc-secondary); font-size: clamp(23px, 3vw, 32px); line-height: 1.25; }
.hmc-section-heading h2::before { content: ""; display: inline-block; width: 5px; height: 27px; margin-inline-end: 10px; vertical-align: -3px; background: var(--hmc-primary); border-radius: 4px; }
.hmc-section-description { max-width: 720px; margin: 8px 0 0; color: var(--hmc-muted); font-size: 14px; line-height: 1.75; }
.hmc-section-heading a { color: var(--hmc-primary-dark); font-weight: 800; white-space: nowrap; }
.hmc-section-heading a:hover { color: var(--hmc-accent); }

.hmc-breaking { display: flex; align-items: center; min-height: 46px; margin-block: 18px 0; overflow: hidden; background: var(--hmc-secondary); color: #fff; border-radius: 10px; }
.hmc-breaking-label { flex: 0 0 auto; padding: 12px 18px; background: var(--hmc-accent); color: #1d2939; font-weight: 900; }
.hmc-breaking-track { display: flex; gap: 36px; min-width: max-content; padding: 0 22px; animation: hmc-ticker 34s linear infinite; }
.hmc-breaking:hover .hmc-breaking-track, .hmc-breaking:focus-within .hmc-breaking-track { animation-play-state: paused; }
.hmc-breaking-track a { color: #fff; font-size: 14px; font-weight: 700; }
.hmc-breaking-track a::before { content: "•"; margin-inline-end: 9px; color: var(--hmc-accent); }
@keyframes hmc-ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .hmc-breaking-track { animation: none; } }

.hmc-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 18px; padding-top: 24px; }
.hmc-hero-main, .hmc-hero-side article { position: relative; overflow: hidden; background: var(--hmc-secondary); border-radius: var(--hmc-radius); }
.hmc-hero-main { min-height: 450px; display: flex; align-items: end; }
.hmc-hero-main img, .hmc-hero-side img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hmc-hero-main::after, .hmc-hero-side article::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 16, 30, .92), rgba(5, 16, 30, .08) 72%); }
.hmc-hero-copy { position: relative; z-index: 1; max-width: 760px; padding: clamp(24px, 4vw, 42px); color: #fff; }
.hmc-hero-copy h1 { margin: 10px 0; color: #fff; font-size: clamp(28px, 4.3vw, 52px); line-height: 1.25; }
.hmc-hero-copy p { max-width: 650px; margin: 0; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.8; }
.hmc-hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 18px; }
.hmc-hero-side article { min-height: 216px; display: flex; align-items: end; }
.hmc-hero-side .hmc-card-copy { position: relative; z-index: 1; padding: 22px; color: #fff; }
.hmc-hero-side h2 { margin: 7px 0 0; color: #fff; font-size: clamp(19px, 2.2vw, 25px); line-height: 1.45; }
.hmc-label { color: var(--hmc-primary); font-size: 13px; font-weight: 900; }
.hmc-hero .hmc-label { color: #9ae6df; }
.hmc-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; color: var(--hmc-muted); font-size: 12px; }
.hmc-hero .hmc-meta { color: rgba(255,255,255,.68); }

.hmc-content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.hmc-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hmc-card { min-width: 0; overflow: hidden; background: var(--hmc-surface); border: 1px solid var(--hmc-border); border-radius: var(--hmc-radius); box-shadow: 0 3px 16px rgba(16,42,67,.03); }
.hmc-card:hover { transform: translateY(-2px); box-shadow: var(--hmc-shadow); }
.hmc-card-image { aspect-ratio: 16 / 9; overflow: hidden; background: #dfe6ec; }
.hmc-card-image img { width: 100%; height: 100%; object-fit: cover; }
.hmc-card-body { padding: 16px; }
.hmc-card h2, .hmc-card h3 { margin: 7px 0 0; color: var(--hmc-secondary); font-size: 18px; line-height: 1.55; }
.hmc-card h2 a, .hmc-card h3 a { color: inherit; }
.hmc-card h2 a:hover, .hmc-card h3 a:hover { color: var(--hmc-primary); }
.hmc-excerpt { margin: 10px 0 0; color: var(--hmc-muted); font-size: 14px; line-height: 1.8; }
.hmc-read-more { display: inline-block; margin-top: 14px; color: var(--hmc-primary-dark); font-size: 13px; font-weight: 900; }

.hmc-sidebar { display: grid; gap: 18px; }
.hmc-widget { padding: 20px; background: var(--hmc-surface); border: 1px solid var(--hmc-border); border-radius: var(--hmc-radius); }
.hmc-widget-title { margin: 0 0 15px; color: var(--hmc-secondary); font-size: 20px; }
.hmc-popular { margin: 0; padding: 0; list-style: none; counter-reset: hmc-popular; }
.hmc-popular li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--hmc-border); counter-increment: hmc-popular; }
.hmc-popular li:last-child { border-bottom: 0; padding-bottom: 0; }
.hmc-popular li::before { content: counter(hmc-popular, decimal-leading-zero); color: var(--hmc-accent); font-size: 18px; font-weight: 900; }
.hmc-popular a { color: var(--hmc-secondary); font-size: 14px; font-weight: 800; line-height: 1.6; }
.hmc-newsletter { color: #fff; background: var(--hmc-secondary); }
.hmc-newsletter .hmc-widget-title { color: #fff; }
.hmc-newsletter p { color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.7; }
.hmc-newsletter input { width: 100%; padding: 11px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; }
.hmc-newsletter button { width: 100%; margin-top: 8px; padding: 11px; border: 0; border-radius: 8px; background: var(--hmc-accent); color: #1d2939; font-weight: 900; }

.hmc-category-block { margin-top: 30px; }
.hmc-category-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.hmc-category-list { display: grid; gap: 12px; }
.hmc-category-list .hmc-card { display: grid; grid-template-columns: 140px minmax(0, 1fr); }
.hmc-category-list .hmc-card-image { aspect-ratio: 1.2; }

.hmc-ad { min-height: 0; margin-block: 18px; text-align: center; overflow: hidden; }
.hmc-ad:empty { display: none; }
.hmc-pagination { display: flex; justify-content: center; gap: 7px; margin-top: 28px; }
.hmc-pagination .page-numbers { display: inline-grid; min-width: 38px; min-height: 38px; place-items: center; padding-inline: 8px; border: 1px solid var(--hmc-border); border-radius: 8px; background: #fff; color: var(--hmc-secondary); font-weight: 800; }
.hmc-pagination .current, .hmc-pagination a:hover { border-color: var(--hmc-primary); background: var(--hmc-primary); color: #fff; }

.hmc-article-wrap { max-width: 920px; margin-inline: auto; }
.hmc-breadcrumbs { margin-bottom: 18px; color: var(--hmc-muted); font-size: 13px; }
.hmc-article-header { padding: clamp(24px, 4vw, 48px); background: #fff; border: 1px solid var(--hmc-border); border-radius: var(--hmc-radius); }
.hmc-article-header h1 { margin: 8px 0 0; color: var(--hmc-secondary); font-size: clamp(29px, 4.6vw, 52px); line-height: 1.3; }
.hmc-article-deck { margin: 16px 0 0; color: var(--hmc-muted); font-size: 18px; line-height: 1.9; }
.hmc-article-cover { margin-top: 22px; overflow: hidden; border-radius: var(--hmc-radius); }
.hmc-article-cover img { width: 100%; max-height: 580px; object-fit: cover; }
.hmc-article-content { margin-top: 20px; padding: clamp(22px, 4vw, 44px); background: #fff; border: 1px solid var(--hmc-border); border-radius: var(--hmc-radius); font-size: 19px; line-height: 2; }
.hmc-article-content h2, .hmc-article-content h3 { color: var(--hmc-secondary); line-height: 1.5; }
.hmc-article-content a { color: var(--hmc-primary-dark); text-decoration: underline; }
.hmc-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hmc-share a, .hmc-share button { padding: 8px 12px; border: 1px solid var(--hmc-border); border-radius: 8px; background: #fff; color: var(--hmc-primary-dark); cursor: pointer; font: inherit; }
.hmc-share-label { align-self: center; margin-inline-end: 4px; color: var(--hmc-secondary); }
.hmc-share a:hover, .hmc-share button:hover { border-color: var(--hmc-primary); background: var(--hmc-primary); color: #fff; text-decoration: none; }
.hmc-related { margin-top: 26px; }

.hmc-search-panel { padding: 22px 0; background: #fff; border-bottom: 1px solid var(--hmc-border); }
.hmc-search-form { display: flex; gap: 8px; }
.hmc-search-form input { min-width: 0; flex: 1; padding: 13px 15px; border: 1px solid var(--hmc-border); border-radius: 8px; font: inherit; }
.hmc-search-form button { padding: 0 20px; border: 0; border-radius: 8px; background: var(--hmc-primary); color: #fff; font-weight: 900; }

@media (max-width: 900px) {
  .hmc-header-inner { min-height: 68px; }
  .hmc-menu-toggle { display: block; order: 3; }
  .hmc-search-toggle { order: 2; }
  .hmc-nav { position: absolute; top: 100%; inset-inline: 0; display: none; padding: 10px 16px 16px; background: #fff; border-bottom: 1px solid var(--hmc-border); box-shadow: var(--hmc-shadow); }
  .hmc-nav.is-open { display: block; }
  .hmc-nav ul { display: grid; gap: 0; justify-content: stretch; }
  .hmc-nav a { padding: 12px 0; border-bottom: 1px solid var(--hmc-border); }
  .hmc-hero { grid-template-columns: 1fr; }
  .hmc-hero-main { min-height: 390px; }
  .hmc-content-layout { grid-template-columns: 1fr; }
  .hmc-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hmc-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .hmc-container { width: min(var(--hmc-container), calc(100% - 24px)); }
  .hmc-topbar .hmc-container { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .hmc-topbar .hmc-container span + span { display: none; }
  .hmc-brand strong { font-size: 20px; }
  .hmc-brand small { display: none; }
  .hmc-brand-logo img { max-width: 165px; max-height: 48px; }
  .hmc-brand .custom-logo { max-width: 165px; max-height: 48px; }
  .hmc-breaking { border-radius: 8px; }
  .hmc-breaking-label { padding-inline: 12px; font-size: 13px; }
  .hmc-hero-main { min-height: 340px; }
  .hmc-hero-side { grid-template-rows: none; grid-template-columns: 1fr; }
  .hmc-hero-side article { min-height: 220px; }
  .hmc-news-grid, .hmc-sidebar, .hmc-category-grid { grid-template-columns: 1fr; }
  .hmc-category-list .hmc-card { grid-template-columns: 112px minmax(0, 1fr); }
  .hmc-category-list .hmc-card-body { padding: 12px; }
  .hmc-category-list .hmc-card h3 { font-size: 15px; }
  .hmc-search-form { display: grid; grid-template-columns: 1fr auto; }
  .hmc-article-content { font-size: 17px; }
}