/* ============================================================
   Al Saahil — صوت الساحل
   Editorial coastal aesthetic.
   ============================================================ */

:root {
  --paper: #f4ede1;
  --paper-light: #fdfaf3;
  --ink: #14202b;
  --ink-soft: #2a3a48;
  --muted: #6b7d87;
  --rule: rgba(20, 32, 43, 0.14);
  --rule-strong: rgba(20, 32, 43, 0.32);
  --accent: #c14528;
  --accent-deep: #9a3520;
  --teal: #1d5c63;

  --display: 'Cairo', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Cairo', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1240px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle paper grain — barely there but adds warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(193, 69, 40, 0.02) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(29, 92, 99, 0.02) 0, transparent 40%);
  z-index: 0;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-deep);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
}

p {
  max-width: 65ch;
}

/* ---------- Header / Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(244, 237, 225, 0.92);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  position: relative;
  display: block;
  box-shadow: 0 2px 8px rgba(20, 32, 43, 0.15);
  border: 2px solid var(--paper);
}

/* Footer flag — slightly different — no light border ring needed on dark bg */
.footer-brand .brand-mark {
  border-color: rgba(244, 237, 225, 0.15);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.15rem;
  display: block;
}

.nav-menu {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  align-items: center;
}

.nav-menu a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.98rem;
  position: relative;
  padding: 0.3rem 0;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.25s ease;
}

.nav-toggle span::before {
  position: absolute;
  top: -7px;
}

.nav-toggle span::after {
  position: absolute;
  top: 7px;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: flex;
  }
  .nav-menu {
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 2rem var(--gutter);
    gap: 1.4rem;
    align-items: flex-start;
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }
  .nav-menu.open {
    transform: translateY(0);
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 1.05;
  margin: 1.5rem 0 1.5rem;
  letter-spacing: -0.02em;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero-title em::after {
  content: '';
  position: absolute;
  inset: auto 0 4px 0;
  height: 8px;
  background: var(--accent);
  opacity: 0.18;
  z-index: -1;
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  max-width: 50ch;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Live stream frame ---------- */
.stream {
  position: relative;
  background: var(--ink);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow:
    0 30px 60px -30px rgba(20, 32, 43, 0.45),
    0 0 0 1px var(--rule);
}

.stream::before {
  content: '';
  position: absolute;
  inset: -10px -10px auto auto;
  width: 100px;
  height: 100px;
  background: var(--accent);
  z-index: -1;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(40px);
}

.stream iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.stream-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--paper);
  text-align: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 30% 40%, rgba(193, 69, 40, 0.18), transparent 60%),
    linear-gradient(135deg, #14202b 0%, #1d5c63 100%);
}

.stream-placeholder .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--paper);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.stream-placeholder .live-dot {
  width: 8px;
  height: 8px;
  background: var(--paper);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.stream-placeholder p {
  font-family: var(--display);
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 30ch;
  margin: 0 auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.8rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: all 0.25s ease;
  border: 1px solid var(--ink);
  cursor: pointer;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn .arrow {
  transition: transform 0.25s ease;
}

/* RTL: arrow points left, moves left on hover */
.btn:hover .arrow {
  transform: translateX(-4px);
}

/* ---------- Sections ---------- */
section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  position: relative;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 3rem;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  line-height: 1;
}

.section-title small {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.5em;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* ---------- News grid ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -25px rgba(20, 32, 43, 0.4);
  border-color: var(--rule-strong);
}

.card-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--teal), var(--ink));
  position: relative;
  overflow: hidden;
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(244, 237, 225, 0.04) 8px,
      rgba(244, 237, 225, 0.04) 16px
    );
}

.card-image .card-num {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  font-family: var(--serif);
  font-size: 4rem;
  font-style: italic;
  color: var(--paper);
  opacity: 0.4;
  line-height: 1;
}

.card-image .card-tag {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--display);
}

.card-body {
  padding: 1.6rem 1.6rem 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--muted);
  border-radius: 50%;
}

.card-title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
}

.card-title a {
  color: inherit;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.3s ease;
}

.card:hover .card-title a {
  background-size: 100% 1px;
}

.card-excerpt {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card-link {
  margin-top: auto;
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- About / Manifesto ---------- */
.about {
  background: var(--paper-light);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-quote {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.4;
  color: var(--ink);
  position: relative;
  padding-right: 2rem;
  border-right: 3px solid var(--accent);
  font-weight: 600;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-text p strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Page intro (subpages) ---------- */
.page-intro {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.page-intro h1 {
  margin-top: 1rem;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

.page-intro .lede {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: 60ch;
  line-height: 1.65;
}

/* ---------- Long-form content (legal pages) ---------- */
.prose {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}

.prose .wrap {
  max-width: 760px;
}

.prose h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.prose p {
  margin-bottom: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.8;
  max-width: 100%;
}

.prose ul,
.prose ol {
  margin-bottom: 1.2rem;
  padding-right: 1.5rem;
  color: var(--ink-soft);
}

.prose li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose blockquote {
  border-right: 3px solid var(--accent);
  padding: 0.5rem 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--paper-light);
  font-weight: 500;
}

.prose .updated {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-light);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info {
  background: var(--paper-light);
  padding: 2.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.contact-info h3 {
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.contact-info p {
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.contact-info dl {
  margin-top: 2rem;
}

.contact-info dt {
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.contact-info dd {
  margin-bottom: 1.4rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.contact-info dd a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}

.contact-info dd a:hover {
  color: var(--accent);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
}

.field label .req {
  color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--rule-strong);
  background: var(--paper-light);
  color: var(--ink);
  border-radius: 4px;
  transition: all 0.2s ease;
  direction: rtl;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 69, 40, 0.12);
}

textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--body);
  line-height: 1.6;
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-status {
  padding: 1rem 1.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  display: none;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: rgba(29, 92, 99, 0.1);
  border: 1px solid var(--teal);
  color: var(--teal);
}

.form-status.error {
  background: rgba(193, 69, 40, 0.08);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3rem, 5vw, 4rem) 0 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand .brand-name {
  color: var(--paper);
}

.footer-brand p {
  color: rgba(244, 237, 225, 0.65);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 40ch;
}

.footer-col h4 {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-col a {
  color: rgba(244, 237, 225, 0.75);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--paper);
}

.footer-bottom {
  border-top: 1px solid rgba(244, 237, 225, 0.12);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: rgba(244, 237, 225, 0.5);
  font-size: 0.85rem;
}

.footer-bottom .credit {
  font-family: var(--serif);
  font-style: italic;
}

/* ---------- Reveal on load ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: fadeUp 0.8s ease-out backwards;
}

.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.15s; }
.reveal-3 { animation-delay: 0.25s; }
.reveal-4 { animation-delay: 0.35s; }

/* ---------- Utility ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
