:root {
  --primary: #003366;
  --secondary: #3e8391;
  --tertiary: #2f557f;
  --accent: #ffa92d;
  --text: #000000;
  --bg: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-400: #adb5bd;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 1200px;
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--accent); }

.logo img { height: 40px; width: auto; }

header nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

header nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

header nav a:hover { color: var(--accent); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 768px) {
  header nav { display: none; }
  header nav.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--primary); padding: 1rem; gap: 1rem; }
  .menu-toggle { display: block; }
  header .container { height: 56px; }
  .logo { font-size: 1.25rem; }
}

/* Site masthead */
.site-masthead {
  text-align: center;
  padding: 3rem 1.5rem 1rem;
}

.masthead-logo {
  max-height: 100px;
  width: auto;
  margin: 0 auto;
}

.masthead-text {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .site-masthead { padding: 2rem 1.5rem 0.5rem; }
  .masthead-text { font-size: 1.75rem; }
  .masthead-logo { max-height: 70px; }
}

/* Greeting / Editorial */
.greeting {
  text-align: center;
  padding: 1.5rem 1.5rem 2.5rem;
  background: var(--gray-50);
  margin-bottom: 2rem;
}

.greeting h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.greeting p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--gray-600);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .greeting { padding: 1.5rem 1.5rem 1.5rem; }
  .greeting h2 { font-size: 1.5rem; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  color: #fff;
  padding: 4rem 0 3rem;
  margin-bottom: 3rem;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.hero-content .meta {
  font-size: 0.9rem;
  opacity: 0.7;
}

.hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.hero-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: #f09c1a;
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Section titles */
.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

/* Cards grid */
section { margin-bottom: 4rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--gray-50);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--gray-200);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-200);
}

.card-body {
  padding: 1.5rem;
}

.card-body .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--primary); }

.card-body p {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-body .meta {
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Article detail */
.article-header {
  padding: 3rem 0 2rem;
  background: var(--gray-50);
}

.article-header .container {
  max-width: 800px;
}

.article-header .tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
}

.article-header .meta {
  color: var(--gray-600);
  font-size: 0.95rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 2rem auto;
  display: block;
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.article-body .excerpt {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--gray-800);
  margin-bottom: 2rem;
  font-style: italic;
}

.content-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.content-body p {
  margin-bottom: 1.25rem;
}

.share-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  border-top: 1px solid var(--gray-200);
}

.share-section > span {
  display: block;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.2;
  color: #fff;
}

.share-btn svg { flex-shrink: 0; }

.share-btn--whatsapp { background: #25D366; }
.share-btn--whatsapp:hover { background: #1da851; }

.share-btn--facebook { background: #1877F2; }
.share-btn--facebook:hover { background: #145dbf; }

.share-btn--twitter { background: #000; }
.share-btn--twitter:hover { background: #333; }

.share-btn--instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.share-btn--instagram:hover {
  opacity: 0.9;
}

.share-btn--copy { background: var(--gray-600); }
.share-btn--copy:hover { background: var(--gray-800); }
.share-btn--copy.copied { background: #28a745; }

/* Gallery mode (grid + lightbox) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item::after {
  content: '🔍';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 2rem;
}

.gallery-item:hover::after { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active { display: flex; }

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  text-align: center;
  max-width: 600px;
  font-style: italic;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Marco / slideshow mode */
.marco {
  margin-top: 2rem;
  user-select: none;
}

.marco-viewport {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
}

.marco-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.4s ease;
}

.marco-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 2;
  line-height: 1;
}

.marco-btn:hover { background: rgba(0,0,0,0.7); }
.marco-prev { left: 1rem; }
.marco-next { right: 1rem; }

.marco-caption {
  text-align: center;
  font-style: italic;
  color: var(--gray-600);
  padding: 1rem 0 0.5rem;
  font-size: 0.95rem;
  min-height: 2.5rem;
}

.marco-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.marco-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.marco-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.marco-dot:hover {
  border-color: var(--secondary);
}

.marco-thumbs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  overflow-x: auto;
  max-width: 100%;
}

.marco-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  flex-shrink: 0;
  border: 2px solid transparent;
}

.marco-thumb.active {
  opacity: 1;
  border-color: var(--primary);
}

.marco-thumb:hover {
  opacity: 0.8;
}

/* Not found */
.not-found {
  text-align: center;
  padding: 6rem 1.5rem;
}

.not-found h1 {
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.not-found p {
  color: var(--gray-600);
  font-size: 1.1rem;
}

/* Admin */
.admin-body {
  background: var(--gray-100);
  min-height: 100vh;
}

.admin-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 0;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.admin-header nav a {
  color: rgba(255,255,255,0.85);
  margin-left: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-header nav a:hover { color: var(--accent); }

.admin-main {
  padding: 2rem 0;
}

.admin-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
}

.admin-card h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--gray-800);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(62,131,145,0.15);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}

.btn-danger:hover { background: #b02a37; }

.btn-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}

.btn-secondary:hover { background: var(--gray-400); }

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}

table th {
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

table tr:hover td { background: var(--gray-50); }

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.message-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Gallery admin — sortable rows */
.gallery-sortable {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gallery-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  transition: opacity 0.2s, box-shadow 0.2s;
}

.gallery-row.dragging {
  opacity: 0.4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-row.drag-over {
  border-color: var(--secondary);
  background: rgba(62,131,145,0.06);
}

.gallery-row.marked-remove {
  opacity: 0.35;
  background: #fff5f5;
  border-color: #dc3545;
}

.drag-handle {
  cursor: grab;
  color: var(--gray-400);
  font-size: 1.2rem;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
  padding: 0.25rem 0;
}

.drag-handle:active { cursor: grabbing; }

.gallery-preview {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--gray-200);
}

.preview-placeholder {
  background: var(--gray-100);
  border: 1px dashed var(--gray-400);
}

.gallery-row input[type="file"] {
  font-size: 0.8rem;
  padding: 0.25rem 0;
  width: 140px;
  flex-shrink: 0;
}

.gallery-row input[type="text"] {
  flex: 1;
  min-width: 100px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.remove-label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.remove-label input { width: auto; cursor: pointer; }

.move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.move-btns button {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  background: var(--gray-200);
  border: none;
  border-radius: 4px;
  color: var(--gray-600);
}

.move-btns button:hover { background: var(--gray-400); color: #fff; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
}

.login-box {
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-box .form-group {
  margin-bottom: 1rem;
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
  margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content h1 { font-size: 1.75rem; }
  .hero-image { display: none; }

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

  .article-header h1 { font-size: 1.75rem; }

  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .form-row { grid-template-columns: 1fr; }

  .admin-header .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
  }

  .marco-viewport { aspect-ratio: 4 / 3; }

  .marco-btn {
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
  }

  .marco-thumbs { gap: 0.35rem; }
  .marco-thumb { width: 48px; height: 36px; }

  .gallery-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .gallery-row input[type="file"] { width: 100%; }

  .gallery-preview { width: 40px; height: 30px; }

  .move-btns { flex-direction: row; }
}
