/* =========================================
   حساب العمر 360 - Stylesheet
   Brand: Teal #00897B | Gold #F4B400
   Dir: RTL | Lang: ar
========================================= */

/* --- Accessibility: Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  right: 0;
  background: var(--accent, #00897B);
  color: #fff;
  padding: .75rem 1.5rem;
  z-index: 9999;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  border-radius: 0 0 0 8px;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
  text-decoration: none;
}

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:       #00897B;
  --accent-dark:  #00695C;
  --accent-light: #E0F2F1;
  --gold:         #F4B400;
  --gold-hover:   #DAA520;
  --gold-light:   #FFF8E1;
  --text-1:       #212121;
  --text-2:       #424242;
  --text-3:       #616161;
  --bg-page:      #FFFFFF;   /* Main Background — Pure White */
  --bg-white:     #FFFFFF;
  --bg-light:     #FAFAFA;   /* Snow White — card backgrounds, inputs */
  --bg-alt:       #F5F5F5;   /* White Smoke — alternate rows, containers */
  --border:       #BDBDBD;
  --error:        #D32F2F;
  --success:      #43A047;
  --shadow-sm:    0 2px 6px rgba(0,0,0,.07);
  --shadow-md:    0 4px 14px rgba(0,0,0,.10);
  --radius:       10px;
  --radius-sm:    6px;
  --footer-bg:    #1B2A2A;
  --font-h:       'Cairo', Tahoma, Arial, sans-serif;
  --font-b:       'Readex Pro', Tahoma, Arial, sans-serif;
  --nav-h:        64px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-b);
  background: var(--bg-page);
  color: var(--text-1);
  direction: rtl;
  line-height: 1.7;
}

/* --- Typography --- */
h1,h2,h3,h4 { font-family: var(--font-h); line-height: 1.35; color: var(--text-1); }
h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; }
h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); font-weight: 600; }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); font-weight: 600; }
p  { color: var(--text-2); margin-bottom: .9rem; }
a  { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; transition: color .2s; }
a:hover { color: var(--gold-hover); }
/* Remove underline from nav, logo, buttons — where context is obvious */
.nav-links a, .logo-wrap, .footer-grid a, .breadcrumb a, .btn-calc, .btn-today, .cta-box a { text-decoration: none; }
.nav-links a:hover, .footer-grid a:hover, .breadcrumb a:hover { text-decoration: underline; }

/* =========================================
   HEADER / NAV
========================================= */
.site-header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--accent);
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo-wrap { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.logo-wrap img { height: 44px; width: auto; }
.logo-text { font-family: var(--font-h); font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.nav-links { display: flex; gap: .25rem; list-style: none; align-items: center; }
.nav-links > li { position: relative; }
.nav-links a, .nav-links .nav-dropdown-toggle {
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-2);
  font-family: var(--font-h);
  transition: background .2s, color .2s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.nav-dropdown-toggle {
  background: none;
  border: none;
}
.nav-dropdown-toggle::after {
  content: ' ▾';
  font-size: .7rem;
}
.nav-links a:hover, .nav-links a.active,
.nav-links .nav-dropdown-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

/* Dropdown menu */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: .5rem 0;
  list-style: none;
  z-index: 200;
}
.nav-dropdown li a {
  display: block;
  padding: .55rem 1.25rem;
  font-size: .88rem;
  white-space: nowrap;
  border-radius: 0;
}
.nav-dropdown li a:hover {
  background: var(--accent-light);
  color: var(--accent);
}
/* Show dropdown on hover or click (desktop) */
.nav-links > li:hover > .nav-dropdown,
.nav-links > li.dropdown-open > .nav-dropdown {
  display: block;
}

.burger { display: none; background: none; border: none; cursor: pointer; padding: .4rem; }
.burger span {
  display: block; width: 24px; height: 2px;
  background: var(--text-1); margin: 5px 0; border-radius: 2px; transition: .3s;
}

/* Mobile nav */
@media(max-width: 680px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 0 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    gap: .5rem;
    transform: translateX(100%);
    transition: transform .3s;
    overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a, .nav-links .nav-dropdown-toggle {
    font-size: 1rem; padding: .7rem 1rem; border-radius: var(--radius-sm);
    display: block; width: 100%;
  }
  .nav-dropdown-toggle { text-align: right; }
  /* Mobile: dropdown is inline accordion */
  .nav-dropdown {
    position: static;
    box-shadow: none;
    display: none;
    padding: 0;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    margin-top: .25rem;
  }
  .nav-links > li.dropdown-open > .nav-dropdown {
    display: block;
    padding: .5rem 0;
  }
  .nav-dropdown li a {
    padding: .5rem 1.5rem;
    font-size: .95rem;
  }
}

/* =========================================
   HERO / INTRO
========================================= */
.hero {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(244,180,0,.08) 0%, transparent 60%),
    linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  color: var(--bg-white);
  text-align: center;
  padding: 3rem 1.25rem 4rem;
  position: relative;
}
.hero h1 { color: var(--bg-white); margin-bottom: .7rem; }
.hero p  { color: rgba(255,255,255,.88); max-width: 640px; margin: 0 auto 0; font-size: 1.05rem; }
.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--text-1);
  font-size: .8rem;
  font-weight: 700;
  padding: .25rem .9rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  font-family: var(--font-h);
}

/* Hero feature pills */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .75rem;
  max-width: 640px;
  margin-inline: auto;
}
.hero-features span {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .82rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Hero social proof */
.hero .hero-trust {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  margin-top: .75rem;
}
.hero-trust strong {
  color: var(--gold);
}

/* Calculator overlap into hero (only when #main-content is NOT the hero itself) */
#main-content:not(.hero) {
  margin-top: -2.5rem;
  position: relative;
  z-index: 1;
}

/* =========================================
   LAYOUT
========================================= */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.section   { padding: 3rem 0; }
.section-alt { background: var(--bg-light); }

/* =========================================
   CARD
========================================= */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* =========================================
   SECTION TITLE
========================================= */
.sec-title {
  text-align: center;
  margin-bottom: 2rem;
}
.sec-title h2 { margin-bottom: .4rem; }
.sec-title p  { color: var(--text-3); margin: 0; }
.sec-title::after {
  content: '';
  display: block;
  width: 50px; height: 3px;
  background: var(--accent);
  margin: .75rem auto 0;
  border-radius: 2px;
}

/* =========================================
   CALCULATOR WIDGET
========================================= */
#age-calculator-section { padding: 2rem 0 3rem; }

.calc-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Calendar/Mode tabs */
.calc-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg-light);
}
.calc-tab {
  flex: 1;
  padding: .9rem .5rem;
  border: none;
  background: none;
  font-family: var(--font-h);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
}
.calc-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-white);
}
.calc-tab:hover { color: var(--accent); }

/* Tab panels */
.calc-panel { display: none; padding: 1.5rem; }
.calc-panel.active { display: block; }

/* Fields row */
.fields-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.field-group { display: flex; flex-direction: column; min-width: 120px; flex: 1 1 100px; }
.field-group label {
  font-family: var(--font-h);
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: .4rem;
  font-weight: 600;
}
.field-group select, .field-group input[type="date"] {
  padding: .55rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-b);
  font-size: .95rem;
  color: var(--text-1);
  background: var(--bg-white);
  transition: border-color .2s;
}
.field-group select:focus, .field-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.calc-person-label {
  font-family: var(--font-h);
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent);
  margin-bottom: .6rem;
  display: block;
}

/* Calculate button */
.btn-calc {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: .85rem 1.5rem;
  background: var(--gold);
  color: var(--text-1);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-calc:hover { background: var(--gold-hover); color: var(--text-1); text-decoration: none; }
.btn-calc:active { transform: scale(.98); }

/* "Today" quick-select button */
.btn-today {
  background: none;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-h);
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem 1.2rem;
  min-height: 36px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-today:hover {
  background: var(--accent);
  color: var(--bg-white);
}

/* ---- Results ---- */
.results-wrap { display: none; margin-top: 1.5rem; }
.results-wrap.visible { display: block; }

/* Results slide-in animation */
@keyframes resultsFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.results-animate { animation: resultsFadeIn .45s ease-out; }

/* Counter blocks */
.counter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media(max-width: 768px) { .counter-grid { grid-template-columns: 1fr; } }

.counter-box {
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(0,0,0,.10);
}
.counter-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.counter-box-title {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  text-align: center;
  padding: .6rem;
  font-family: var(--font-h);
  font-size: .95rem;
  font-weight: 700;
}
.counter-box.gold .counter-box-title {
  background: linear-gradient(135deg, var(--gold), var(--gold-hover));
  color: var(--text-1);
}
.counter-inner { display: flex; }
.counter-table {
  flex: 1;
  border-collapse: collapse;
  text-align: center;
}
.counter-table td {
  padding: .5rem .3rem;
  border: 1px solid #EEEEEE;
  font-size: clamp(11px, 2.5vw, 14px);
}
.counter-table tr:first-child td {
  background: var(--bg-alt);
  color: var(--text-2);
  font-family: var(--font-h);
  font-size: .78rem;
  font-weight: 700;
}
.counter-table tr:last-child td {
  font-weight: 700;
  font-size: clamp(15px, 3.5vw, 20px);
  color: var(--accent-dark);
  background: #fff;
}
.counter-box.gold .counter-table tr:last-child td {
  color: #B8860B;
}

/* Detail tables */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
/* Swap detail block order when Hijri tab is active (RTL: first = right) */
.details-grid.hijri-first #greg-detail-block  { order: 2; }
.details-grid.hijri-first #hijri-detail-block { order: 1; }
@media(max-width: 700px) { .details-grid { grid-template-columns: 1fr; } }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media(max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }

.result-box {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: 0 3px 15px rgba(0,0,0,.10);
  overflow: hidden;
  border: none;
}
.result-box-title {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-bottom: 2px solid var(--accent);
  padding: .65rem 1rem;
  font-family: var(--font-h);
  font-size: .95rem;
  font-weight: 700;
  text-align: center;
}
/* Primary detail blocks — full gradient titles */
#greg-detail-block .result-box-title {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-bottom: none;
}
#hijri-detail-block .result-box-title {
  background: linear-gradient(135deg, #00796B, #004D40);
  color: #fff;
  border-bottom: none;
}
/* Gold box — life stats */
.result-box.gold {
  border-right: none;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--bg-white) 40%);
}
.result-box.gold .result-box-title {
  background: linear-gradient(135deg, var(--gold), var(--gold-hover));
  color: var(--text-1);
  border-bottom: none;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}
.result-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid #E8E8E8;
  font-size: clamp(12px, 2.8vw, 14px);
  vertical-align: middle;
}
.result-table tr:nth-child(even) td {
  background: var(--bg-alt);
}
.result-table td:first-child {
  font-family: var(--font-h);
  font-weight: 600;
  color: var(--text-2);
  width: 55%;
}
.result-table td:last-child {
  color: var(--accent-dark);
  font-weight: 700;
}
.result-box.gold .result-table td:last-child {
  color: #B8860B;
}
.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--accent-light); transition: background .15s; }

/* Spacing between result sections */
.info-grid + .result-box { margin-top: 1rem; }
.info-grid + .result-box + .result-box { margin-top: 1rem; }

/* Personality box — teal left-border accent (RTL: right) */
.result-box.personality-box {
  border-right: 4px solid var(--accent);
}

/* Milestones box — gold left-border accent (RTL: right) */
.result-box.milestones-box {
  border-right: 4px solid var(--gold);
}
.result-box.milestones-box .result-box-title {
  background: var(--gold-light);
  color: var(--text-1);
  border-bottom: 2px solid var(--gold);
}

/* Milestones table */
.milestones-table td { font-size: clamp(12px, 2.8vw, 14px); }
.milestones-table td:first-child { width: 45%; }
.milestones-table td:nth-child(3) { font-weight: 600; color: var(--accent-dark); }
.result-table.milestones-table thead td { font-weight: 700; background: var(--accent-light); }

/* Age diff result */
.diff-result-box {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--accent-light), var(--gold-light));
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.diff-result-box .diff-main {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-family: var(--font-h);
  font-weight: 700;
  color: var(--accent-dark);
}
.diff-result-box p { margin: .4rem 0 0; font-size: .95rem; }

/* Diff calendar toggle */
.diff-cal-btn {
  padding: .45rem 1.25rem;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-h);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.diff-cal-btn.active {
  background: var(--accent);
  color: #fff;
}
.diff-cal-btn:hover:not(.active) {
  background: var(--accent-light);
}

/* =========================================
   CONTENT SECTIONS
========================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
  text-align: center;
}
.feature-card:hover { box-shadow: var(--shadow-md); }
.feature-icon {
  width: 52px; height: 52px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}
.feature-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.feature-card p  { font-size: .88rem; margin: 0; color: var(--text-3); }

/* Info article */
.article-content h2 { margin-bottom: .75rem; color: var(--accent-dark); }
.article-content h3 { margin: 1.25rem 0 .5rem; color: var(--text-1); font-size: 1.05rem; }
.article-content p  { margin-bottom: .9rem; line-height: 1.8; }
.article-content ul, .article-content ol {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}
.article-content li { margin-bottom: .4rem; line-height: 1.7; }

/* Tables in content */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
.content-table th {
  background: var(--bg-alt);
  color: var(--text-1);
  border-bottom: 2px solid var(--accent);
  padding: .65rem .85rem;
  text-align: right;
  font-family: var(--font-h);
  font-weight: 700;
}
.content-table td {
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
.content-table tr:nth-child(odd)  td { background: var(--bg-alt); }
.content-table tr:nth-child(even) td { background: var(--bg-white); }

/* =========================================
   FAQ ACCORDION
========================================= */
.faq-list { list-style: none; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: var(--bg-white);
  border: none;
  padding: 1rem 1.25rem;
  text-align: right;
  font-family: var(--font-h);
  font-size: .97rem;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  transition: background .2s;
}
.faq-question:hover { background: var(--accent-light); }
.faq-question .faq-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  transition: transform .2s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  display: none;
  padding: .9rem 1.25rem 1rem;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  line-height: 1.8;
  font-size: .93rem;
}
.faq-item.open .faq-answer { display: block; }

/* =========================================
   BREADCRUMB
========================================= */
.breadcrumb {
  font-size: .82rem;
  color: var(--text-3);
  padding: .6rem 0;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: var(--text-3); }

/* Breadcrumb on dark hero background */
.hero .breadcrumb { color: rgba(255,255,255,.75); }
.hero .breadcrumb a { color: #fff; font-weight: 600; }
.hero .breadcrumb a:hover { color: var(--gold); text-decoration: underline; }
.hero .breadcrumb span { color: rgba(255,255,255,.6); }

/* =========================================
   FOOTER
========================================= */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  border-top: 3px solid var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
@media(max-width: 680px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-col { padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
  .footer-col:last-child { border-bottom: none; }
}

.footer-brand img  { height: 40px; margin-bottom: .75rem; }
.footer-brand p    { font-size: .85rem; line-height: 1.8; color: rgba(255,255,255,.55); }
.footer-col h3.footer-heading, .footer-col h4 {
  color: var(--bg-white);
  font-family: var(--font-h);
  margin-bottom: .75rem;
  font-size: .95rem;
  position: relative;
  padding-bottom: .5rem;
}
.footer-col h3.footer-heading::after, .footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a  {
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  transition: color .2s, padding-right .2s;
  display: inline-block;
}
.footer-col a:hover {
  color: var(--gold);
  text-decoration: none;
  padding-right: .3rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}

/* =========================================
   BACK TO TOP
========================================= */
.back-top {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 44px; height: 44px;
  background: var(--accent);
  color: var(--bg-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background .2s;
  z-index: 99;
}
.back-top.show { display: flex; }
.back-top:hover { background: var(--accent-dark); }

/* =========================================
   EXTRA BREAKPOINTS
========================================= */
/* Tablet */
@media(max-width: 768px) {
  .two-col { grid-template-columns: 1fr !important; }
  .diff-grid { grid-template-columns: 1fr !important; }
}

/* Very small phones */
@media(max-width: 380px) {
  h1 { font-size: 1.25rem; }
  .hero { padding: 2rem .75rem 2.5rem; }
  .hero p { font-size: .9rem; }
  .hero-features span { font-size: .75rem; padding: .2rem .6rem; }
  .calc-tab { font-size: .78rem; padding: .7rem .3rem; }
  .calc-panel { padding: 1rem; }
  .counter-table td { font-size: 10px; padding: .3rem .15rem; }
  .counter-table tr:first-child td { font-size: .7rem; }
  .counter-table tr:last-child td { font-size: 12px; }
  .counter-grid { gap: .6rem; }
  .result-table td { padding: .35rem .5rem; font-size: 11px; }
  .btn-calc { font-size: .9rem; padding: .7rem 1rem; }
  .features-grid { grid-template-columns: 1fr; }
  .diff-main { font-size: 1.1rem !important; }
}

/* Counter grid on small phones — extra adjustments */
@media(max-width: 500px) {
  .counter-table tr:last-child td { font-size: 15px; }
}

/* Short tab labels on small phones */
@media(max-width: 500px) {
  .calc-tab { font-size: 0; }
  .calc-tab::after { font-size: .8rem; font-family: var(--font-h); font-weight: 600; }
  .calc-tab[data-cal="gregorian"]::after { content: "الميلادي"; }
  .calc-tab[data-panel="panel-hijri"]::after { content: "الهجري"; }
  .calc-tab[data-panel="panel-diff"]::after { content: "فرق العمر"; }
}

/* =========================================
   UTILITIES
========================================= */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-family: var(--font-h);
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* =========================================
   FOCUS-VISIBLE (keyboard-only outlines)
========================================= */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* =========================================
   PRINT
========================================= */
@media print {
  .site-header, .site-footer, .burger, .nav-links,
  .back-top, .skip-link, .btn-calc, .hero-badge, .hero-features, .hero-trust { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { color: inherit; text-decoration: underline; }
  .calc-card, .section { box-shadow: none; border: 1px solid #ccc; }
}
