
/* === Global Reset & Fluid Typography === */
* { box-sizing: border-box; }
html { font-size: 100%; }
@media (max-width: 480px) { html { font-size: 95%; } }
@media (max-width: 360px) { html { font-size: 90%; } }

body {
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Fluid Media === */
img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Containers === */
.container, .wrapper, .content, main, section, article {
  width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 24px);
}

/* === Headings spacing === */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; margin: 0.6em 0 0.4em; }
p { margin: 0.6em 0; }

/* === Navigation (works with typical <nav><ul><li>) === */
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 2vw, 16px);
}
nav a {
  text-decoration: none;
  display: block;
  padding: 10px 12px;
}
/* Collapse nav into vertical on small screens */
@media (max-width: 720px) {
  nav ul { flex-direction: column; align-items: flex-start; }
  nav a { padding-left: 0; }
}

/* === Grids (generic helpers if authors used common classnames) === */
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.col, [class*="col-"] { flex: 1 1 300px; min-width: 0; }
@media (max-width: 720px) {
  .row { gap: 12px; }
  .col, [class*="col-"] { flex: 1 1 100%; }
}

/* === Gallery (works if container has .gallery/.images/.grid-gallery) === */
.gallery, .images, .grid-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(8px, 2vw, 16px);
}
.gallery img, .images img, .grid-gallery img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* === Tables (scrollable on mobile) === */
.table-responsive { width: 100%; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* === Forms === */
form { width: 100%; max-width: 720px; }
input, select, textarea, button {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0 12px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 8px;
  font: inherit;
}
button, .btn, input[type="submit"] {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
}

/* === Utility classes === */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }

/* === Contrast & Readability helpers === */
.readable-on-image, .text-shadow {
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.overlay-dark::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
}
/* Force minimum color contrast for dark backgrounds */
.on-dark, header .on-dark, .hero .on-dark { color: #fff !important; }

/* === Footer layout === */
footer { margin-top: 2rem; padding: 1rem 0; }
