/* Mahaldeeb — Maldivian Heritage Archive */

:root {
  --ocean-deep: #0a3d62;
  --ocean-mid: #1a6b7a;
  --ocean-light: #2d9cba;
  --sand: #f5f0e8;
  --sand-dark: #e8dfd0;
  --coral: #c45c3e;
  --coral-light: #d97a5f;
  --ink: #1a1a1a;
  --ink-muted: #5a5a5a;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(10, 61, 98, 0.08);
  --shadow-lg: 0 12px 48px rgba(10, 61, 98, 0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ocean-mid);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--coral);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ocean-deep);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p + p { margin-top: 1rem; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--sand-dark);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ocean-deep);
  letter-spacing: 0.02em;
}

.logo-tagline {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ocean-deep);
  margin: 5px 0;
  transition: 0.3s;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--ocean-deep);
  background: var(--sand);
}

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--ocean-mid) 50%, var(--ocean-light) 100%);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: "";
  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;
  max-width: 720px;
  padding: 4rem 1.5rem;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 1rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.92;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}

.btn-primary:hover {
  background: var(--coral-light);
  border-color: var(--coral-light);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
  color: var(--white);
}

.btn-secondary {
  background: var(--ocean-deep);
  color: var(--white);
  border-color: var(--ocean-deep);
}

.btn-secondary:hover {
  background: var(--ocean-mid);
  border-color: var(--ocean-mid);
  color: var(--white);
}

/* Page header (inner pages) */
.page-header {
  background: linear-gradient(135deg, var(--ocean-deep), var(--ocean-mid));
  color: var(--white);
  padding: 4rem 0 3rem;
  text-align: center;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--white);
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--white);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--ink-muted);
  margin-top: 0.75rem;
}

.section-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--ocean-mid), var(--ocean-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.3);
}

.card-body {
  padding: 1.5rem;
}

.card-body h3 {
  margin-bottom: 0.5rem;
}

.card-body p {
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Feature blocks */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-visual {
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--ocean-mid), var(--ocean-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 4rem;
  box-shadow: var(--shadow-lg);
}

.feature-content h2 {
  margin-bottom: 1rem;
}

.feature-content p {
  color: var(--ink-muted);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ocean-deep);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--sand-dark);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 2.5rem 3rem;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 0;
  width: 16px;
  height: 16px;
  background: var(--coral);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.timeline-item:nth-child(odd) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.timeline-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.timeline-card h3 {
  margin-bottom: 0.5rem;
}

.timeline-card p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--sand-dark), var(--ocean-light));
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s;
  opacity: 0.85;
}

.gallery-item:hover {
  transform: scale(1.02);
  opacity: 1;
}

/* Quote / oral history */
.quote-block {
  background: var(--white);
  border-left: 4px solid var(--coral);
  padding: 2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.quote-block blockquote {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ocean-deep);
  margin-bottom: 1rem;
}

.quote-attribution {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.quote-attribution strong {
  color: var(--ink);
}

/* Content prose */
.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h2 {
  margin: 2.5rem 0 1rem;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
}

.prose ul, .prose ol {
  margin: 1rem 0 1rem 1.5rem;
  color: var(--ink-muted);
}

.prose li {
  margin-bottom: 0.5rem;
}

/* Two column content */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.sidebar-box {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.sidebar-box h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.sidebar-box ul {
  list-style: none;
}

.sidebar-box li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--sand-dark);
  font-size: 0.9375rem;
}

.sidebar-box li:last-child {
  border-bottom: none;
}

/* Contact form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ocean-mid);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: var(--sand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--ocean-deep), var(--ocean-mid));
  color: var(--white);
  padding: 4rem 0;
  text-align: center;
}

.cta-banner h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.cta-banner p {
  opacity: 0.9;
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* Footer */
.site-footer {
  background: var(--ocean-deep);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand .logo-text {
  color: var(--white);
  font-size: 1.75rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-col h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  opacity: 0.6;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Tool / item list */
.item-list {
  display: grid;
  gap: 1.5rem;
}

.item-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  align-items: center;
}

.item-thumb {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--sand-dark), var(--ocean-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.6;
}

.item-card h3 {
  margin-bottom: 0.25rem;
}

.item-card .meta {
  font-size: 0.8rem;
  color: var(--coral);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.item-card p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* Tag */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--sand);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ocean-mid);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-box {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--sand-dark);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    box-shadow: var(--shadow-lg);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    padding: 0.75rem 1rem;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .feature-row.reverse {
    direction: ltr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 1rem;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    left: 0;
    padding-left: 3rem;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: calc(1rem - 8px);
    right: auto;
  }

  .item-card {
    grid-template-columns: 1fr;
  }

  .item-thumb {
    width: 100%;
    height: 160px;
  }
}
