/* ===== Variables ===== */
:root {
  --primary: #27491f;
  --primary-dark: #1a3315;
  --primary-light: #3d6b34;
  --accent: #5a8c4a;
  --bg: #faf9f6;
  --bg-section: #f2f0eb;
  --text: #1a1a1a;
  --text-muted: #555;
  --white: #fff;
  --border: rgba(39, 73, 31, 0.15);
  --shadow: 0 4px 20px rgba(39, 73, 31, 0.08);
  --radius: 8px;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  z-index: 200;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius);
}

.main-nav a:hover {
  background: var(--bg-section);
  color: var(--primary);
  text-decoration: none;
}

.main-nav .lang {
  font-size: 0.85em;
  color: var(--text-muted);
  font-weight: 400;
}

.lang-switcher-wrap {
  margin-left: 0.5rem;
}

.lang-switcher {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.lang-switcher a {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  color: var(--text-muted);
}

.lang-switcher a:hover {
  background: var(--bg-section);
  color: var(--primary);
  text-decoration: none;
}

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

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

/* ===== Container ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Hero ===== */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.hero-tagline {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--white);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--bg);
  color: var(--primary-dark);
  text-decoration: none;
}

/* ===== Sections ===== */
.section {
  padding: 4rem 0;
}

.section:nth-child(even) {
  background: var(--bg-section);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 1rem;
}

.section-intro {
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 60ch;
}

/* ===== Announcements ===== */
.announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.announcement-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.announcement-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.announcement-card p {
  margin: 0 0 0.5rem;
}

.announcement-card p:last-child {
  margin-bottom: 0;
}

.lang-block {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* ===== Prayer Timings ===== */
.prayer-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.prayer-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.prayer-table th,
.prayer-table td {
  padding: 0.85rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.prayer-table thead {
  background: var(--primary);
  color: var(--white);
}

.prayer-table th {
  font-weight: 600;
}

.prayer-table tbody tr:last-child td {
  border-bottom: none;
}

.prayer-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Mawaqit prayer times widget */
.mawaqit-wrap {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}

.mawaqit-wrap .widget {
  display: block;
  width: 100%;
  min-height: 380px;
  border: 0;
}

/* ===== Sadaqah ===== */
.sadaqah-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sadaqah-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sadaqah-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.sadaqah-card p {
  margin: 0;
}

.sadaqah-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Location ===== */
.address-block {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.address-block h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.address-block p {
  margin: 0 0 1rem;
}

.address-block .btn {
  margin-top: 0.5rem;
}

.accessibility-notice {
  background: rgba(39, 73, 31, 0.08);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
}

.accessibility-notice p {
  margin: 0 0 0.5rem;
}

.accessibility-notice p:last-child {
  margin-bottom: 0;
}

.directions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.directions-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.directions-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.directions-card p {
  margin: 0 0 0.5rem;
}

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-embed iframe {
  display: block;
  width: 100%;
  min-height: 360px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.9);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.95);
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.footer-copy {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ===== Inner pages (Blog, Quran, Islam) ===== */
.page-main {
  padding-top: 4.5rem;
}

.page-header {
  padding-top: 2rem;
}

.page-header .section-intro {
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.blog-card h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.blog-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.blog-card p {
  margin: 0 0 1rem;
}

.link-arrow {
  font-weight: 600;
}

.blog-back {
  margin-top: 2rem;
  margin-bottom: 0;
}

.blog-back a {
  text-decoration: none;
}

.blog-back a:hover {
  text-decoration: underline;
}

/* Quran page */
.quran-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.quran-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quran-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(39, 73, 31, 0.12);
  text-decoration: none;
  color: var(--text);
}

.quran-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.quran-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quran-card-other {
  grid-column: 1 / -1;
  max-width: 320px;
}

/* Islam page */
.content-block {
  margin-bottom: 2rem;
}

.content-block h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.content-block p {
  margin: 0;
}

.pillars-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 1.25rem;
}

.pillars-list {
  display: grid;
  gap: 1rem;
}

.pillar-card {
  background: var(--white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.pillar-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.pillar-card p {
  margin: 0;
}

/* Mosques page */
.mosques-region {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary);
  margin: 2rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
}

.mosques-region:first-of-type {
  margin-top: 0;
}

.mosques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.mosque-card {
  background: var(--white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.mosque-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
}

.mosque-card p {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.mosque-card p:last-child {
  margin-bottom: 0;
}

.mosque-card a {
  word-break: break-all;
}

.mosques-source {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mosques-source a {
  font-weight: 500;
}

/* ===== Mobile Nav ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .main-nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }

  .main-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .main-nav li:not(.lang-switcher-wrap) > a {
    border-bottom: 1px solid var(--border);
  }

  .lang-switcher-wrap {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .lang-switcher {
    justify-content: flex-start;
  }

  .hero {
    min-height: 60vh;
    padding: 5rem 1rem 3rem;
  }

  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0.6rem 1rem;
  }

  .container {
    padding: 0 1rem;
  }
}
