:root {
  --ink: #102a2c;
  --ink-soft: #446064;
  --paper: #fffaf0;
  --surface: #ffffff;
  --surface-soft: #f4f8ee;
  --green: #0f766e;
  --green-dark: #0a4e49;
  --mint: #dceee7;
  --gold: #c58e2e;
  --gold-soft: #f2d493;
  --rose: #b4545c;
  --sky: #d9edf4;
  --line: #d8ded3;
  --shadow: 0 18px 50px rgba(18, 42, 44, 0.13);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf6 0%, #eef7f2 47%, #fff8e6 100%);
  background-size: 48px 48px, auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(16, 42, 44, 0.12);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2px solid var(--green-dark);
  border-radius: var(--radius);
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--mint);
  color: var(--green-dark);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--green-dark);
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: clamp(560px, 72vh, 760px);
  overflow: hidden;
  background: var(--green-dark);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 36, 38, 0.86) 0%, rgba(7, 36, 38, 0.66) 38%, rgba(7, 36, 38, 0.16) 70%),
    linear-gradient(180deg, rgba(7, 36, 38, 0.12), rgba(7, 36, 38, 0.2));
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: inherit;
  max-width: 1180px;
  margin: 0 auto;
  padding: 96px 5vw 86px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold-soft);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  width: 100%;
  max-width: 760px;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: clamp(3.2rem, 8vw, 6.7rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero-copy {
  width: 100%;
  max-width: 650px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
}

.hero-actions,
.contact-lines {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button span {
  margin-right: 9px;
  font-weight: 900;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--gold);
  color: #1a241d;
  box-shadow: 0 12px 28px rgba(197, 142, 46, 0.28);
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.overview-strip article {
  min-height: 174px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.82);
}

.overview-strip span {
  display: block;
  margin-bottom: 10px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.overview-strip strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.overview-strip p,
.section-heading p,
.activity-card p,
.announcement-item p,
.contact-copy p,
.gallery-layout p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.section {
  padding: 88px 5vw;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 36px;
  text-align: center;
}

.section-heading h2,
.gallery-layout h2,
.contact-copy h2 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.agenda-list {
  display: grid;
  max-width: 980px;
  margin: 0 auto;
  gap: 14px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 42, 44, 0.06);
}

.agenda-item time {
  display: grid;
  place-items: center;
  min-height: 76px;
  border-radius: var(--radius);
  background: var(--mint);
  color: var(--green-dark);
  font-weight: 900;
}

.agenda-item.is-featured {
  border-color: rgba(197, 142, 46, 0.5);
  background: #fff7df;
}

.agenda-item h3,
.activity-card h3,
.announcement-item h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.agenda-item p,
.announcement-item p,
.activity-card p {
  margin-bottom: 0;
}

.section-schedule {
  background:
    linear-gradient(135deg, rgba(217, 237, 244, 0.78), rgba(244, 248, 238, 0.96)),
    var(--surface-soft);
}

.schedule-tabs {
  display: flex;
  max-width: 860px;
  margin: 0 auto 20px;
  padding: 6px;
  gap: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.tab-button {
  min-width: 96px;
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 900;
  cursor: pointer;
}

.tab-button.is-active {
  background: var(--green);
  color: #ffffff;
}

.schedule-panels {
  max-width: 860px;
  margin: 0 auto;
}

.schedule-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.schedule-panel[hidden] {
  display: none;
}

.schedule-panel div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 42, 44, 0.06);
}

.schedule-panel span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  background: #f7e6b7;
  color: #583b07;
  font-weight: 900;
}

.schedule-panel strong {
  align-self: end;
  font-size: 1.12rem;
}

.schedule-panel small {
  color: var(--ink-soft);
}

.empty-schedule {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed rgba(15, 118, 110, 0.35);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  text-align: center;
}

.activity-grid,
.announcement-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1120px;
  margin: 0 auto;
  gap: 18px;
}

.activity-card,
.announcement-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(16, 42, 44, 0.07);
}

.activity-visual {
  position: relative;
  height: 170px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--mint);
}

.activity-photo {
  width: 100%;
  height: 170px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  object-fit: cover;
}

.activity-visual::before,
.activity-visual::after {
  content: "";
  position: absolute;
}

.visual-reading {
  background: linear-gradient(135deg, #d9edf4, #f7e6b7);
}

.visual-reading::before {
  inset: 38px 32px 44px;
  border: 10px solid var(--green);
  border-top: 0;
  border-radius: 0 0 70px 70px;
}

.visual-reading::after {
  left: 50%;
  bottom: 34px;
  width: 10px;
  height: 78px;
  background: var(--gold);
  transform: translateX(-50%);
}

.visual-class {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(180deg, #e7f1dc, #d9edf4);
  background-size: 28px 28px, auto;
}

.visual-class::before {
  left: 28px;
  right: 28px;
  top: 36px;
  height: 74px;
  border: 8px solid var(--green-dark);
  border-radius: var(--radius);
  background: rgba(15, 118, 110, 0.14);
}

.visual-class::after {
  left: 54px;
  right: 54px;
  bottom: 32px;
  height: 16px;
  border-radius: 99px;
  background: var(--gold);
}

.visual-service {
  background: linear-gradient(135deg, #f7e6b7, #f7d9d4 54%, #dceee7);
}

.visual-service::before {
  left: 34px;
  top: 34px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 68px 20px 0 var(--green), 134px -6px 0 var(--gold);
}

.visual-service::after {
  left: 42px;
  right: 42px;
  bottom: 36px;
  height: 18px;
  border-radius: 99px;
  background: rgba(16, 42, 44, 0.22);
}

.section-gallery {
  background: #122f31;
  color: #ffffff;
}

.gallery-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  gap: 40px;
}

.gallery-layout p {
  color: rgba(255, 255, 255, 0.78);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 14px;
}

.gallery-grid img {
  width: 100%;
  min-height: 220px;
  height: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.gallery-grid img:first-child {
  grid-row: span 2;
  min-height: 460px;
}

.gallery-crop-left {
  object-position: 15% 55%;
}

.gallery-crop-right {
  object-position: 85% 70%;
}

.status {
  display: inline-flex;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-green {
  background: var(--mint);
  color: var(--green-dark);
}

.status-gold {
  background: #f7e6b7;
  color: #674605;
}

.status-red {
  background: #f7d9d4;
  color: #7b2830;
}

.section-contact {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.75fr);
  align-items: start;
  gap: 34px;
  max-width: 1160px;
  margin: 0 auto;
}

.contact-copy {
  padding-top: 12px;
}

.contact-lines {
  display: grid;
  margin-top: 24px;
  gap: 10px;
}

.contact-lines p {
  margin: 0;
  border-left: 5px solid var(--gold);
  padding: 12px 0 12px 16px;
  background: rgba(255, 255, 255, 0.58);
}

.message-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.message-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 900;
}

.message-form input,
.message-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

.message-form input:focus,
.message-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-note {
  min-height: 24px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 800;
}

.form-note.is-error {
  color: #7b2830;
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(197, 142, 46, 0.13)),
    #fffaf0;
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 250px;
  border-radius: var(--radius);
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(16, 42, 44, 0.92), rgba(16, 42, 44, 0.7)),
    url("assets/hero-pesantren.png") center/cover;
  color: #ffffff;
}

.admin-hero h1 {
  width: auto;
  max-width: 700px;
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
}

.admin-hero p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.admin-card,
.admin-toolbar,
.admin-savebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(16, 42, 44, 0.07);
}

.admin-card {
  margin-top: 18px;
  padding: 24px;
}

.admin-card h2,
.admin-toolbar h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.admin-card > p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 900;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

.admin-form input:focus,
.admin-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.admin-editor {
  margin-top: 18px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.admin-toolbar h2,
.admin-toolbar .eyebrow {
  margin-bottom: 0;
}

.admin-logout {
  color: var(--green-dark);
  border-color: var(--line);
  background: #f7fbf7;
}

.admin-field-grid,
.admin-upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-field-grid-four {
  grid-template-columns: 0.8fr 1fr 1.4fr 110px;
}

.admin-repeat {
  display: grid;
  gap: 14px;
}

.admin-mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fffdf8;
}

.admin-mini-card h3 {
  margin-bottom: 14px;
}

.admin-check {
  align-content: end;
}

.admin-check input {
  width: 22px;
  height: 22px;
}

.upload-box {
  display: grid;
  min-height: 72px;
  place-content: center;
  border: 1px dashed rgba(15, 118, 110, 0.45);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(220, 238, 231, 0.38);
  text-align: center;
  cursor: pointer;
}

.upload-box input {
  max-width: 100%;
  margin-top: 10px;
  border: 0;
  padding: 0;
  background: transparent;
}

.schedule-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.schedule-editor-heading h3 {
  margin-bottom: 0;
}

.schedule-edit-grid {
  display: grid;
  grid-template-columns: 100px 0.52fr 1fr 1.2fr 92px;
  gap: 12px;
  align-items: end;
}

.admin-small-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-weight: 900;
  cursor: pointer;
}

.admin-danger-button {
  background: #f7d9d4;
  color: #7b2830;
}

.admin-small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 5vw;
  border-top: 1px solid var(--line);
  background: #102a2c;
  color: rgba(255, 255, 255, 0.84);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #f2d493;
  font-weight: 900;
}

@media (max-width: 980px) {
  .overview-strip,
  .activity-grid,
  .announcement-list,
  .gallery-layout,
  .section-contact {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-layout,
  .section-contact {
    gap: 28px;
  }

  .admin-field-grid,
  .admin-field-grid-four,
  .admin-upload-row,
  .schedule-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 0 18px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 18px;
    right: 18px;
    top: calc(100% + 10px);
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
  }

  .hero {
    min-height: 640px;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(7, 36, 38, 0.9) 0%, rgba(7, 36, 38, 0.64) 50%, rgba(7, 36, 38, 0.24) 100%);
  }

  .hero-content {
    padding: 80px 22px 64px;
  }

  h1 {
    font-size: clamp(2.55rem, 11.5vw, 3.4rem);
    line-height: 1;
  }

  .overview-strip,
  .activity-grid,
  .announcement-list,
  .gallery-layout,
  .section-contact,
  .schedule-panel {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 68px 22px;
  }

  .agenda-item {
    grid-template-columns: 1fr;
  }

  .agenda-item time {
    min-height: 56px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid img:first-child,
  .gallery-grid img {
    min-height: 220px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 12px;
  }

  .admin-hero,
  .admin-toolbar,
  .admin-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero,
  .admin-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .brand small {
    display: none;
  }

  .hero-actions {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .overview-strip article {
    min-height: 150px;
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
