/* ============================================================
   SMAN 2 Sumenep — Redesign UI/UX
   Palet diturunkan dari logo SMADA: charcoal + emas
   ============================================================ */

:root {
  --ink: #24262b;          /* charcoal — struktur utama */
  --ink-2: #34373e;
  --ink-3: #4a4e57;
  --gold: #e6b400;         /* emas logo — aksi & aksen */
  --gold-soft: #f6e5a3;
  --gold-deep: #8f7300;    /* emas gelap — aman untuk teks di atas putih */
  --paper: #f7f6f2;        /* kanvas hangat */
  --white: #ffffff;
  --text: #24262b;
  --muted: #676b74;
  --line: #e6e4dd;

  --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  --maxw: 1140px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36,38,43,.06), 0 8px 24px rgba(36,38,43,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 10px 18px; font-weight: 600; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: var(--white);
}
.site-header .container {
  display: flex; align-items: center; gap: 28px;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; font-weight: 700;
}
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name .top { font-size: 15px; letter-spacing: .01em; }
.brand-name .sub { font-size: 11px; font-weight: 500; color: #b9bcc4; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 4px; list-style: none; }
.main-nav a {
  display: block; padding: 9px 14px; border-radius: 8px;
  text-decoration: none; font-size: 14.5px; font-weight: 500;
  color: #d4d6db;
}
.main-nav a:hover { color: var(--white); background: var(--ink-2); }
.main-nav a.active { color: var(--gold); }

.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  font-weight: 700; font-size: 14.5px; text-decoration: none;
  border: 0; cursor: pointer; font-family: var(--font-body);
  transition: transform .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #f2c41a; }
.btn-ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-line { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 0; color: var(--white);
  width: 44px; height: 44px; cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--white);
  padding: 96px 0 88px;
}
.hero::before {
  content: "SMADA";
  position: absolute; right: -30px; bottom: -60px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(140px, 26vw, 320px); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(230,180,0,.22);
  letter-spacing: -.04em;
  pointer-events: none; user-select: none;
}
.hero .container { position: relative; max-width: 880px; }
.hero .eyebrow { color: var(--gold); }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(38px, 6vw, 64px); line-height: 1.05;
  letter-spacing: -.02em; margin: 14px 0 18px;
}
.hero h1 .accent { color: var(--gold); }
.hero .lead { font-size: 18px; color: #c9ccd3; max-width: 560px; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 36px;
}
.hero-stats span {
  font-size: 13px; font-weight: 600; color: #d4d6db;
  border: 1px solid rgba(255,255,255,.18);
  padding: 7px 14px; border-radius: 999px;
}

/* ---------- Sections ---------- */

.section { padding: 72px 0; }
.section.alt { background: var(--paper); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-deep);
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--gold); border-radius: 2px; }

.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 20px; margin-bottom: 34px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.015em;
  margin-top: 10px;
}
.link-more {
  font-weight: 700; font-size: 14.5px; text-decoration: none;
  color: var(--gold-deep); white-space: nowrap;
}
.link-more:hover { text-decoration: underline; }

/* ---------- Layanan digital ---------- */

.apps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.app-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 20px;
  text-decoration: none; display: block;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.app-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: var(--gold);
}
.app-card .icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--ink); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.app-card .icon svg { width: 22px; height: 22px; }
.app-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.app-card p { font-size: 13.5px; color: var(--muted); }
.app-card .ext {
  font-size: 12.5px; font-weight: 700; color: var(--gold-deep);
  margin-top: 12px; display: inline-block;
}

/* ---------- Berita ---------- */

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; min-height: 360px; }

.news-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.thumb {
  aspect-ratio: 16 / 9; background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.ph::after {
  content: ""; width: 54px; height: 54px; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f7300' stroke-width='1.6'%3E%3Cpath d='M12 3l8 3v5c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6l8-3z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.news-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gold-deep);
  background: var(--gold-soft); padding: 3px 10px; border-radius: 999px;
}
.news-body h3 {
  font-size: 16.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-body p {
  font-size: 14px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Pagination */
.pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }
.pagination button {
  border: 1.5px solid var(--line); background: var(--white); color: var(--muted);
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
}
.pagination button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.pagination button.active { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  border: 1.5px solid var(--line); background: var(--white);
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--gold); }

/* ---------- Sambutan teaser ---------- */

.greet {
  display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: center;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px;
}
.greet .photo {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--gold);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.greet .photo img { width: 100%; height: 100%; object-fit: cover; }
.greet h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.greet p { color: var(--muted); font-size: 15px; }
.greet .who { font-size: 13.5px; font-weight: 700; color: var(--gold-deep); margin-top: 12px; }

/* ---------- Galeri ---------- */

.gallery-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; min-height: 400px; }
.g-item {
  aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  cursor: pointer; padding: 0; position: relative;
}
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.g-item:hover img { transform: scale(1.05); }
.g-item.ph::after {
  content: attr(data-caption);
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; text-align: center;
  padding: 12px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}

dialog.lightbox {
  border: 0; border-radius: 16px; padding: 0; margin: auto;
  width: 880px; max-width: 92vw; background: var(--ink);
}
dialog.lightbox::backdrop { background: rgba(20,21,24,.82); }
.lightbox figure { display: flex; flex-direction: column; margin: 0; }
.lightbox figure img { width: 100%; max-height: 72vh; object-fit: contain; display: block; border-radius: 16px 16px 0 0; }
.lightbox figcaption { color: #d4d6db; font-size: 14px; padding: 14px 20px; }
.lightbox .close {
  position: absolute; top: 10px; right: 10px;
  background: var(--gold); color: var(--ink); border: 0;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; font-weight: 700; cursor: pointer;
  z-index: 10;
}

/* ---------- Page hero (halaman dalam) ---------- */

.page-hero {
  background: var(--ink); color: var(--white);
  padding: 56px 0 48px; position: relative; overflow: hidden;
}
.page-hero::before {
  content: "SMADA";
  position: absolute; right: -20px; bottom: -46px;
  font-family: var(--font-display); font-weight: 800;
  font-size: 160px; line-height: 1; color: transparent;
  -webkit-text-stroke: 1.2px rgba(230,180,0,.18);
  pointer-events: none;
}
.page-hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -.02em;
  margin-top: 12px;
}
.page-hero p { color: #c9ccd3; margin-top: 8px; max-width: 620px; }

/* ---------- Profil ---------- */

.subnav {
  position: sticky; top: 68px; z-index: 40;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.subnav ul {
  display: flex; gap: 4px; list-style: none; overflow-x: auto;
  padding: 10px 0;
}
.subnav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  text-decoration: none; white-space: nowrap;
}
.subnav a:hover, .subnav a.active { background: var(--paper); color: var(--ink); }

.prose { max-width: 720px; }
.prose h2 {
  font-family: var(--font-display); font-size: 28px; letter-spacing: -.015em;
  margin: 0 0 16px;
}
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 22px; margin-top: 12px; }
.prose li + li { margin-top: 8px; }
.anchor-target { scroll-margin-top: 140px; }

.info-table { width: 100%; border-collapse: collapse; max-width: 720px; }
.info-table th, .info-table td {
  text-align: left; padding: 13px 16px; font-size: 14.5px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.info-table th { width: 220px; color: var(--muted); font-weight: 600; }

/* ---------- Detail berita ---------- */

.article { max-width: 720px; margin: 0 auto; }
.article .news-meta { margin-bottom: 14px; }
.article h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.02em;
  margin-bottom: 22px;
}
.article .cover {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 28px;
  aspect-ratio: 16/9; background: var(--paper);
}
.article .content p + p { margin-top: 16px; }
.article .content { font-size: 16.5px; }

/* ---------- Kontak ---------- */

.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.contact-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.contact-list { list-style: none; }
.contact-list li {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.contact-list li:last-child { border-bottom: 0; }
.contact-list .ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px;
  background: var(--ink); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.contact-list .ic svg { width: 19px; height: 19px; }
.contact-list b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }

.map-frame {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 4/3; background: var(--paper);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

.form-grid { display: grid; gap: 14px; margin-top: 8px; }
.form-grid label { font-size: 13.5px; font-weight: 700; }
.form-grid input, .form-grid textarea {
  width: 100%; padding: 12px 14px; margin-top: 6px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 14.5px;
}
.form-grid input:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.form-note { font-size: 12.5px; color: var(--muted); }

/* ---------- CTA band ---------- */

.cta-band { background: var(--ink); color: var(--white); }
.cta-band .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 52px; padding-bottom: 52px; flex-wrap: wrap;
}
.cta-band h2 {
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.015em;
}
.cta-band p { color: #c9ccd3; margin-top: 6px; }

/* ---------- Footer ---------- */

.site-footer { background: #1c1e22; color: #b9bcc4; font-size: 14px; }
.site-footer .grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px;
  padding: 56px 0 40px;
}
.site-footer h4 {
  color: var(--white); font-size: 14px; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 16px;
}
.site-footer ul { list-style: none; }
.site-footer li + li { margin-top: 10px; }
.site-footer a { color: #b9bcc4; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--white); font-weight: 700; }
.footer-brand img { width: 32px; height: 32px; object-fit: contain; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0; font-size: 13px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-strip { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .site-footer .grid > div:first-child { grid-column: span 2; }
}

@media (max-width: 850px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--ink); border-top: 1px solid var(--ink-2);
    padding: 10px 16px 18px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 13px 12px; font-size: 16px; }
  .header-cta { display: none; }
}

@media (max-width: 680px) {
  .hero { padding: 64px 0 60px; }
  .news-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-strip { grid-template-columns: repeat(2, 1fr); }
  .greet { grid-template-columns: 1fr; text-align: center; }
  .greet .photo { margin: 0 auto; }
  .site-footer .grid { grid-template-columns: 1fr; }
  .site-footer .grid > div:first-child { grid-column: span 1; }
  .section { padding: 52px 0; }
}
