/* ============================================
   RukenRohat.com — Vibrant Heritage v3
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=Noto+Sans+Arabic:wght@400;500;600&display=swap');

:root {
  --crimson: #A93344;
  --crimson-dark: #8C2838;
  --teal: #1A7A6E;
  --teal-dark: #14605A;
  --saffron: #D4952E;
  --saffron-light: #E8B35A;
  --ivory: #FDFAF5;
  --sand: #F2EBDF;
  --clay: #8B5E3C;
  --chocolate: #3A2218;
  --text: #3A2218;
  --text-mid: #6B5548;
  --text-light: #9A8A7E;
  --border: #E4D9CC;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(58,34,24,0.06);
  --shadow-md: 0 6px 24px rgba(58,34,24,0.08);
  --shadow-lg: 0 12px 40px rgba(58,34,24,0.1);
  --shadow-xl: 0 20px 60px rgba(58,34,24,0.13);
  --radius: 4px;
  --radius-md: 8px;
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --max-width: 1140px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: "Inter", -apple-system, sans-serif;
  color: var(--text);
  background: var(--ivory);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[lang="ku"] body { font-family: "Noto Sans Arabic", "Inter", sans-serif; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--crimson); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal); }

h1, h2, h3, h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--chocolate);
  line-height: 1.15;
  margin-bottom: 0.6em;
  font-weight: 600;
}

h1 { font-size: clamp(2.8rem, 5.5vw, 4.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-family: "Inter", sans-serif; font-weight: 600; }

p { margin-bottom: 1rem; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Divider --- */
.kilim-divider {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--saffron) 33%, var(--teal) 66%, var(--crimson) 100%);
  opacity: 0.25;
}

/* --- Header --- */
.site-header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
}

.site-logo {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--chocolate);
}

.site-logo span {
  color: var(--crimson);
  font-weight: 400;
  font-style: italic;
}

.main-nav { display: flex; align-items: center; gap: 2.5rem; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links a {
  color: var(--text-mid);
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--crimson); }
.nav-links a.active { color: var(--crimson); font-weight: 600; }

.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--sand);
  padding: 3px;
  border-radius: var(--radius);
}

.lang-switcher a {
  color: var(--text-light);
  padding: 4px 9px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all var(--transition);
  border-radius: 3px;
}

.lang-switcher a:hover { color: var(--text); }
.lang-switcher a.active { color: var(--white); background: var(--crimson); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.menu-toggle:hover { border-color: var(--crimson); color: var(--crimson); }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 50%, #6A2030 100%);
  color: var(--white);
  padding: 7rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M50 10 L90 50 L50 90 L10 50Z' fill='none' stroke='%23fff' stroke-width='0.3' opacity='0.06'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(212,149,46,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text h1 {
  color: var(--white);
  font-size: clamp(3rem, 6vw, 4.8rem);
  margin-bottom: 0.15em;
  font-weight: 700;
  line-height: 1.05;
}

.hero-text .tagline {
  color: var(--saffron-light);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  font-style: italic;
  font-weight: 400;
  margin-bottom: 1.8rem;
}

.hero-text p {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  max-width: 440px;
  line-height: 1.8;
  font-weight: 300;
}

.hero-books {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.hero-books img {
  width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  transition: transform 0.5s cubic-bezier(0.25,0.1,0.25,1);
  border: 2px solid rgba(255,255,255,0.1);
}

.hero-books img:nth-child(2) { transform: translateY(-14px); }
.hero-books img:hover { transform: translateY(-6px); }
.hero-books img:nth-child(2):hover { transform: translateY(-20px); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-align: center;
  border-radius: var(--radius);
}

.btn-primary {
  background: var(--saffron);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--saffron-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,149,46,0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-secondary:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.btn-amazon {
  background: var(--crimson);
  color: var(--white);
}
.btn-amazon:hover {
  background: var(--crimson-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(169,51,68,0.25);
}

.btn-sm { padding: 0.55rem 1.5rem; font-size: 0.75rem; }

/* On non-hero contexts */
.section .btn-secondary {
  color: var(--crimson);
  border-color: var(--crimson);
}
.section .btn-secondary:hover {
  background: var(--crimson);
  color: var(--white);
}

/* --- Sections --- */
.section { padding: 6rem 0; }
.section-alt { background: var(--white); }
.section-green { background: var(--sand); }

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  margin-bottom: 0.4em;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--saffron);
  margin: 0.6rem auto 0;
  border-radius: 2px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0.8rem auto 0;
  font-weight: 300;
}

/* --- Bio --- */
.bio-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: start;
}

.bio-image {
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--saffron);
  border-radius: var(--radius-md);
}

.bio-text h2 { margin-bottom: 1rem; }
.bio-text p { color: var(--text-mid); line-height: 1.85; font-weight: 300; }

/* --- SVG Icons --- */
.svg-icon {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto 1.4rem;
}

.svg-icon-sm {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

.svg-icon path, .svg-icon circle, .svg-icon line, .svg-icon polyline, .svg-icon rect, .svg-icon ellipse {
  stroke: var(--saffron);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.contact-info-card .svg-icon-sm path,
.contact-info-card .svg-icon-sm circle,
.contact-info-card .svg-icon-sm line,
.contact-info-card .svg-icon-sm polyline,
.contact-info-card .svg-icon-sm rect {
  stroke: var(--saffron-light);
}

/* --- Book Cards --- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.book-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.25,0.1,0.25,1), box-shadow 0.4s;
  border: 1px solid var(--border);
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.book-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--sand);
}

.book-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25,0.1,0.25,1);
}

.book-card:hover .book-card-image img { transform: scale(1.04); }

.book-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--crimson);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.book-card-body { padding: 1.4rem 1.4rem 1.6rem; }

.book-card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.book-card-body p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  line-height: 1.6;
  font-weight: 300;
}

.book-card-links { display: flex; gap: 0.5rem; }

/* --- Book Filter --- */
.book-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.8rem;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}

.filter-btn:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

.filter-btn.active {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--white);
}

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

.mission-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.mission-card:hover {
  border-color: var(--saffron);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.mission-card h3 { margin-bottom: 0.75rem; color: var(--chocolate); }
.mission-card p { color: var(--text-light); font-size: 0.92rem; line-height: 1.7; font-weight: 300; }

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  color: var(--text-mid);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,110,0.1);
}

.form-group textarea { min-height: 140px; resize: vertical; }

.contact-info-card {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-md);
}

.contact-info-card h3 {
  color: var(--white);
  margin-bottom: 2rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.contact-info-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

/* --- Downloads --- */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.download-card {
  background: var(--white);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.download-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.download-card h3 { margin-bottom: 0.5rem; }
.download-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1.5rem; font-weight: 300; line-height: 1.65; }

/* --- Page Header --- */
.page-header {
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-dark) 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M50 10 L90 50 L50 90 L10 50Z' fill='none' stroke='%23fff' stroke-width='0.3' opacity='0.06'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.page-header h1 {
  color: var(--white);
  position: relative;
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
}

.page-header p {
  color: var(--saffron-light);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.15rem;
  position: relative;
}

/* --- Footer --- */
.site-footer {
  background: #1B5E3B;
  color: rgba(255,255,255,1);
  padding: 4rem 0 0;
}

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

.footer-brand .site-logo { margin-bottom: 1rem; }
.footer-brand .site-logo { color: var(--white); }
.footer-brand .site-logo span { color: var(--saffron); }

.footer-brand p {
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  max-width: 280px;
  line-height: 1.7;
  font-weight: 300;
}

.footer-col h4 {
  color: var(--saffron);
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }

.footer-col ul a {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  transition: color var(--transition);
  font-weight: 300;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25,0.1,0.25,1), transform 0.7s cubic-bezier(0.25,0.1,0.25,1);
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

.form-success {
  background: rgba(26,122,110,0.08);
  color: var(--teal-dark);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: none;
  border-left: 3px solid var(--teal);
}

.form-error {
  background: rgba(169,51,68,0.06);
  color: var(--crimson);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: none;
  border-left: 3px solid var(--crimson);
}

/* --- Responsive --- */
@media (max-width: 968px) {
  .hero { padding: 5rem 0 4rem; }
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
  .hero-text p { margin: 0 auto 2.5rem; }
  .hero-text > div { justify-content: center; }
  .hero-books { order: -1; max-width: 420px; margin: 0 auto; }
  .bio-grid { grid-template-columns: 1fr; text-align: center; }
  .bio-image { max-width: 220px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition);
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-links { flex-direction: column; width: 100%; }
  .nav-links a { display: block; padding: 0.6rem 0; text-align: center; }
  .lang-switcher { justify-content: center; }
  .section { padding: 4rem 0; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand p { margin: 0 auto; }
  .books-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .mission-grid { grid-template-columns: 1fr; }
  .downloads-grid { grid-template-columns: 1fr; }
  .page-header { padding: 3.5rem 0 3rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .header-inner { height: 64px; }
  .hero { padding: 3rem 0; }
  .hero-books { gap: 0.5rem; }
  .books-grid { grid-template-columns: 1fr; }
  .container { padding: 0 1.2rem; }
}

@media print {
  .site-header, .site-footer, .lang-switcher, .menu-toggle { display: none; }
  body { color: #000; background: #fff; }
}

/* --- Logo Image --- */
.site-logo-img {
  height: 80px;
  width: auto;
  display: block;
}

.footer-logo-img {
  height: 64px;
  width: auto;
  display: block;
  margin-bottom: 1rem;
  
}

@media (max-width: 768px) {
  .site-logo-img { height: 60px; }
  .footer-logo-img { height: 50px; }
}

/* --- Featured Download --- */
.download-featured {
  margin-bottom: 3rem;
}

.download-featured-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.download-featured-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.download-featured-info h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--crimson);
  margin-bottom: 1rem;
}

.download-featured-info p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.download-featured-info .btn {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .download-featured-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.5rem;
  }
  .download-featured-img img {
    max-width: 240px;
    margin: 0 auto;
  }
}
