/* ============================================
   IslamHood.org — Main Stylesheet
   Fonts: Cormorant Garamond, DM Sans, Amiri
   ============================================ */

:root {
  --color-bg: #FAFAF9;
  --color-surface: #FFFFFF;
  --color-text: #1C1917;
  --color-text-secondary: #57534E;
  --color-text-muted: #78716C;
  --color-text-faint: #A8A29E;
  --color-border: #E7E5E0;
  --color-border-light: #F5F5F4;
  --color-gold: #C9A84C;
  --color-gold-light: #FAF5E8;
  --color-dark: #1C1917;
  --color-success: #1D7A56;
  --color-error: #DC2626;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-arabic: 'Amiri', Georgia, serif;
  --max-width: 900px;
  --story-width: 700px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }
*:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; border-radius: 4px; }

/* ===== NAV ===== */
.site-nav { position: sticky; top: 0; z-index: 100; background: rgba(250,250,249,0.92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--color-border); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--color-dark); display: flex; align-items: center; justify-content: center; color: var(--color-gold); font-family: var(--font-heading); font-weight: 700; font-size: 17px; }
.logo-text { font-family: var(--font-heading); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav-links a.active { color: var(--color-text); font-weight: 600; border-bottom-color: var(--color-gold); }
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; }
.hamburger span { width: 20px; height: 2px; background: var(--color-text); border-radius: 1px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }
@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 12px 24px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--color-border-light); }
  .hamburger { display: flex; }
}

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: 10px; font-size: 14px; font-weight: 500; border: none; transition: all 0.2s; }
.btn-primary { background: var(--color-dark); color: #FAFAF9; }
.btn-primary:hover { background: #292524; }
.btn-outline { background: transparent; color: var(--color-text); border: 1.5px solid var(--color-text); }
.btn-gold { background: var(--color-gold); color: var(--color-dark); font-weight: 600; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }

/* ===== HERO ===== */
.hero { padding: 72px 24px 32px; text-align: center; }
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero-label { font-size: 12px; color: var(--color-gold); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 16px; }
.hero-title { font-family: var(--font-heading); font-size: clamp(36px, 7vw, 64px); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 20px; }
.hero-subtitle { font-size: 18px; color: var(--color-text-muted); max-width: 520px; margin: 0 auto 36px; line-height: 1.65; font-weight: 300; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== FEATURED ===== */
.featured-section { max-width: var(--max-width); margin: 0 auto 48px; padding: 0 24px; }
.featured-card { display: flex; flex-wrap: wrap; background: var(--color-surface); border-radius: 16px; overflow: hidden; border: 1px solid var(--color-border); transition: box-shadow 0.2s; }
.featured-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.featured-image { flex: 0 0 auto; width: 170px; min-height: 170px; display: flex; align-items: center; justify-content: center; margin: 24px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--hue) 15%, white), color-mix(in srgb, var(--hue) 30%, white)); }
.featured-letter { font-size: 56px; font-family: var(--font-heading); font-weight: 600; opacity: 0.5; }
.featured-body { flex: 1; padding: 24px 24px 24px 0; min-width: 240px; }
.featured-label { font-size: 11px; color: var(--color-gold); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px; }
.featured-body h2 { font-family: var(--font-heading); font-size: 24px; font-weight: 600; line-height: 1.25; margin-bottom: 10px; }
.featured-body p { font-size: 15px; color: var(--color-text-secondary); line-height: 1.6; font-weight: 300; margin-bottom: 14px; }
.featured-meta { font-size: 13px; color: var(--color-text-faint); }

/* ===== STORIES GRID ===== */
.stories-section { max-width: var(--max-width); margin: 0 auto; padding: 0 24px 48px; }
.stories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.stories-grid-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ===== STORY CARD ===== */
.story-card { background: var(--color-surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--color-border); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.story-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.card-image { height: 150px; display: flex; align-items: center; justify-content: center; position: relative; background: linear-gradient(135deg, var(--hue-bg), color-mix(in srgb, var(--hue-accent) 20%, white)); }
.card-letter { font-size: 44px; font-family: var(--font-heading); font-weight: 700; opacity: 0.12; color: var(--hue-accent); }
.card-badge { position: absolute; font-size: 11px; padding: 3px 10px; border-radius: 14px; background: rgba(255,255,255,0.88); font-weight: 500; }
.card-category { top: 12px; left: 12px; }
.card-time { top: 12px; right: 12px; color: var(--color-text-secondary); }
.card-body { padding: 16px 18px 18px; }
.card-title { font-family: var(--font-heading); font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
.card-excerpt { font-size: 14px; color: var(--color-text-muted); line-height: 1.5; font-weight: 300; margin-bottom: 12px; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-faint); }

/* ===== FILTERS ===== */
.filters-bar { margin-bottom: 20px; }
.category-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { font-size: 12px; padding: 7px 16px; border-radius: 24px; background: var(--color-border-light); color: var(--color-text-secondary); transition: all 0.2s; }
.pill.active { background: var(--color-dark); color: #FAFAF9; font-weight: 600; }
.search-sort-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.search-form { flex: 1 1 240px; max-width: 360px; }
.search-form input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--color-border); border-radius: 12px; font-size: 14px; font-family: var(--font-body); background: var(--color-bg); outline: none; }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-form label { font-size: 12px; color: var(--color-text-faint); }
.sort-form select { padding: 8px 12px; border: 1.5px solid var(--color-border); border-radius: 10px; font-size: 13px; font-family: var(--font-body); background: var(--color-bg); outline: none; }
.results-count { margin-top: 14px; font-size: 13px; color: var(--color-text-muted); display: flex; justify-content: space-between; }
.page-indicator { font-size: 12px; color: var(--color-text-faint); }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.page-btn, .page-num { padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--color-border); background: var(--color-surface); font-size: 13px; font-weight: 500; color: var(--color-text); }
.page-num { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.page-num.active { border-color: var(--color-gold); background: var(--color-gold-light); color: #8A6A1A; font-weight: 600; }
.page-dots { padding: 0 4px; color: var(--color-text-faint); }

/* ===== STORY PAGE ===== */
.story-page { max-width: var(--story-width); margin: 0 auto; padding: 48px 24px 80px; }
.breadcrumbs ol { display: flex; align-items: center; gap: 6px; list-style: none; font-size: 13px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs li:not(:first-child)::before { content: '/'; color: var(--color-border); margin-right: 6px; }
.breadcrumbs [aria-current] { color: var(--color-text); font-weight: 500; }
.story-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.badge { font-size: 12px; padding: 4px 14px; border-radius: 20px; font-weight: 500; }
.badge-muted { background: var(--color-border-light); color: var(--color-text-secondary); }
.story-article h1 { font-family: var(--font-heading); font-size: clamp(30px, 5vw, 44px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 14px; }
.story-byline { font-size: 15px; color: var(--color-text-muted); margin-bottom: 20px; }
.story-byline strong { color: var(--color-text-secondary); font-weight: 500; }
.story-lede { font-size: 16px; color: var(--color-text-secondary); line-height: 1.6; font-style: italic; font-weight: 300; border-left: 3px solid var(--color-gold); padding-left: 16px; margin-bottom: 24px; }
.story-body { border-top: 1px solid var(--color-border); padding-top: 36px; margin-top: 28px; }
.story-body p { font-size: 17.5px; line-height: 1.9; color: #292524; margin-bottom: 26px; font-weight: 300; }
.reading-progress { position: fixed; top: 60px; left: 0; height: 3px; background: linear-gradient(90deg, var(--color-gold), #E8C86A); z-index: 99; width: 0; transition: width 0.15s ease-out; border-radius: 0 2px 2px 0; }

/* ===== PULL QUOTE ===== */
.pull-quote { margin: 32px 0 36px; padding: 28px 32px; border-left: 3px solid var(--color-gold); background: linear-gradient(135deg, #FAF8F2, #F5F0E5); }
.pull-quote p { font-family: var(--font-heading); font-size: clamp(20px, 3.5vw, 26px); font-weight: 500; line-height: 1.4; font-style: italic; margin: 0; color: var(--color-text); }

/* ===== QURAN VERSE ===== */
.quran-verse { margin-top: 16px; padding: 32px 28px; background: linear-gradient(135deg, var(--color-dark), #292524); border-radius: 16px; text-align: center; }
.qv-label { font-size: 11px; color: var(--color-gold); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px; }
.qv-arabic { font-size: clamp(22px, 4vw, 30px); font-family: var(--font-arabic); color: #FAFAF9; line-height: 1.6; margin-bottom: 12px; }
.qv-english { font-family: var(--font-heading); font-size: 18px; font-style: italic; color: #D6D3CD; line-height: 1.5; margin-bottom: 8px; }
.qv-ref { font-size: 13px; color: var(--color-text-muted); }

/* ===== REACTIONS ===== */
.reactions-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.reaction-btn { display: flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 28px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--color-border); background: var(--color-bg); color: var(--color-text-secondary); transition: all 0.3s; }
.reaction-btn.reacted { border-color: var(--color-gold); background: var(--color-gold-light); color: #8A6A1A; transform: scale(1.05); }
.reaction-icon { font-size: 17px; }
.reaction-count { font-size: 12px; opacity: 0.6; }

/* ===== SHARE ===== */
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; border: none; }
.share-x { background: #0f1419; color: #fff; }
.share-wa { background: #25D366; color: #fff; }
.share-fb { background: #1877F2; color: #fff; }
.share-copy { background: var(--color-border-light); color: var(--color-text-secondary); cursor: pointer; }
.share-copy.copied { background: #E8F5EA; color: #1A6A3A; }

/* ===== GLOSSARY ===== */
.glossary-term { border-bottom: 1.5px dotted var(--color-gold); cursor: help; position: relative; }
.glossary-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--color-dark); color: #FAFAF9; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; width: 260px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }

/* ===== STORY SECTIONS ===== */
.story-reactions, .story-share-bottom { padding: 28px; background: var(--color-border-light); border-radius: 16px; margin-top: 16px; }
.story-reactions h3, .story-share-bottom h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.story-share-bottom { text-align: center; }
.story-share-bottom p { font-size: 14px; color: var(--color-text-muted); margin-bottom: 18px; }
.story-share-bottom .share-buttons { justify-content: center; }
.related-stories { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--color-border); }
.related-label { font-size: 11px; color: var(--color-gold); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px; }
.related-stories h3 { font-family: var(--font-heading); font-size: 22px; font-weight: 600; margin-bottom: 24px; }
.story-cta { margin-top: 48px; padding: 32px; border: 1.5px solid var(--color-gold); border-radius: 16px; text-align: center; }
.story-cta h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.story-cta p { font-size: 14px; color: var(--color-text-muted); margin-bottom: 20px; }

/* ===== SUBMIT PAGE ===== */
.submit-page { max-width: 620px; margin: 0 auto; padding: 48px 24px 80px; }
.submit-page h1 { font-family: var(--font-heading); font-size: 34px; font-weight: 600; margin-bottom: 8px; }
.submit-intro { font-size: 16px; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 36px; }
.form-group { margin-bottom: 20px; }
.form-group label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 1.5px solid var(--color-border); border-radius: 10px; font-size: 15px; font-family: var(--font-body); background: var(--color-bg); outline: none; }
.form-group textarea { min-height: 260px; resize: vertical; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-2 { grid-column: span 2; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.form-hint { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }
.form-note { font-size: 12px; color: var(--color-text-faint); text-align: center; margin-top: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ===== ALERTS ===== */
.alert { padding: 16px 20px; border-radius: 14px; margin-bottom: 24px; font-size: 14px; }
.alert-success { background: #DCFCE7; border: 1px solid #BBF7D0; color: #166534; }
.alert-error { background: #FEE2E2; border: 1px solid #FECACA; color: #991B1B; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 24px; background: var(--color-surface); border-radius: 16px; border: 1px solid var(--color-border); }
.empty-title { font-size: 18px; font-family: var(--font-heading); font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; }

/* ===== BACK TO TOP ===== */
.back-to-top { position: fixed; bottom: 28px; right: 28px; z-index: 90; width: 44px; height: 44px; border-radius: 12px; background: var(--color-dark); color: #FAFAF9; border: none; font-size: 18px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.back-to-top.visible { opacity: 1; pointer-events: auto; }

/* ===== FOOTER ===== */
.site-footer { border-top: 1px solid var(--color-border); padding: 48px 24px; text-align: center; }
.footer-brand { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.footer-tagline { font-size: 13px; color: var(--color-text-faint); margin-bottom: 16px; }
.footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { font-size: 13px; color: var(--color-text-muted); }
.footer-social { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; }
.footer-social a { font-size: 12px; color: var(--color-text-faint); }
.footer-copy { font-size: 12px; color: var(--color-border); }

/* ===== ADMIN ===== */
.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--color-surface); padding: 40px; border-radius: 16px; border: 1px solid var(--color-border); max-width: 380px; width: 100%; }
.login-card h2 { font-family: var(--font-heading); font-size: 24px; margin-bottom: 6px; }
.login-card p { color: var(--color-text-muted); font-size: 14px; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--color-border); border-radius: 10px; font-size: 15px; margin-bottom: 12px; font-family: var(--font-body); outline: none; }
.back-link { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--color-text-muted); }
.admin-header { background: var(--color-dark); padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.admin-logo { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: #FAFAF9; }
.admin-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.admin-nav a { font-size: 13px; color: var(--color-text-faint); }
.admin-nav a.active { color: var(--color-gold); }
.admin-logout { color: #EF4444 !important; }
.admin-content { max-width: 1000px; margin: 0 auto; padding: 24px; }
.admin-content h1 { font-family: var(--font-heading); font-size: 28px; margin-bottom: 24px; }
.admin-content h2 { font-family: var(--font-heading); font-size: 20px; margin: 32px 0 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.stat-card { background: var(--color-surface); padding: 20px; border-radius: 14px; border: 1px solid var(--color-border); text-align: center; }
.stat-num { font-size: 28px; font-weight: 600; }
.stat-label { font-size: 13px; color: var(--color-text-muted); }
.admin-table { margin-bottom: 24px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.row-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.row-actions { display: flex; gap: 6px; }
.status-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.status-published { background: #DCFCE7; color: #166534; }
.status-draft { background: #FEF3C7; color: #854D0E; }
.status-pending { background: #FEF3C7; color: #854D0E; }
.status-featured { background: #F3F0FF; color: #5B21B6; }
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 600; margin-left: 4px; }
.story-form { max-width: 800px; }
.story-form h3 { font-family: var(--font-heading); font-size: 18px; margin: 24px 0 12px; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
