/*
 * Vale del Rei Residents Association — stylesheet
 *
 * Palette taken from the badge logo:
 *   Navy   #1B3A5C  — primary text and dark accents
 *   Gold   #D4A843  — secondary accents, links on dark backgrounds
 *   Cream  #F5F0E1  — page background (matches the book range)
 *   White  #FFFFFF  — card backgrounds and light surfaces
 *
 * Type:
 *   Headings — Georgia, serif (matches the badge text)
 *   Body     — system sans for readability on small screens
 */

/* ───── Reset / base ──────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #1B3A5C;
  background-color: #F5F0E1;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: #1B3A5C;
  text-decoration: underline;
  text-decoration-color: rgba(212, 168, 67, 0.5);
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: #D4A843;
  text-decoration-color: #D4A843;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", serif;
  color: #1B3A5C;
  margin-top: 0;
  line-height: 1.25;
}

h1 { font-size: 2.4rem; margin-bottom: 1rem; }
h2 { font-size: 1.8rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.4rem; }

p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1.1rem;
  padding-left: 1.2rem;
}

ul li,
ol li {
  margin-bottom: 0.4rem;
}

/* ───── Layout containers ─────────────────────────────────────────────── */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3rem 0;
}

.section--alt {
  background-color: #ffffff;
}

/* ───── Header / navigation ───────────────────────────────────────────── */

.site-header {
  background-color: #1B3A5C;
  color: #F5F0E1;
  padding: 1.2rem 0;
  border-bottom: 4px solid #D4A843;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 56px;
  height: 56px;
  background-color: #F5F0E1;
  border-radius: 50%;
  padding: 4px;
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  color: #F5F0E1;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.brand-text small {
  display: block;
  font-size: 0.75rem;
  color: #D4A843;
  letter-spacing: 1.5px;
  margin-top: 0.1rem;
}

.brand:hover .brand-text strong {
  color: #D4A843;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: #F5F0E1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.is-active {
  color: #D4A843;
  border-bottom-color: #D4A843;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(245, 240, 225, 0.3);
}

.lang-switcher a {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #F5F0E1;
  background-color: transparent;
  border: 1px solid rgba(245, 240, 225, 0.4);
  border-radius: 3px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-switcher a:hover,
.lang-switcher a.is-active {
  color: #1B3A5C;
  background-color: #D4A843;
  border-color: #D4A843;
}

/* Mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #D4A843;
  color: #F5F0E1;
  padding: 0.5rem 0.8rem;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 3px;
}

@media (max-width: 880px) {
  .nav-toggle {
    display: inline-block;
  }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(245, 240, 225, 0.2);
  }
  .main-nav.is-open {
    display: flex;
  }
  .lang-switcher {
    margin: 0.6rem 0 0;
    padding: 0.6rem 0 0;
    border-left: none;
    border-top: 1px solid rgba(245, 240, 225, 0.3);
    width: 100%;
  }
}

/* ───── Hero section ──────────────────────────────────────────────────── */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background-color: #F5F0E1;
  border-bottom: 1px solid rgba(27, 58, 92, 0.1);
}

.hero img {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 0.4rem;
}

.hero p.hero-sub {
  font-size: 1.15rem;
  color: rgba(27, 58, 92, 0.75);
  font-style: italic;
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 2rem; }
  .hero p.hero-sub { font-size: 1rem; }
}

/* ───── Page header (non-home pages) ──────────────────────────────────── */

.page-header {
  background-color: #1B3A5C;
  color: #F5F0E1;
  padding: 2.5rem 0;
}

.page-header h1 {
  color: #F5F0E1;
  margin: 0;
}

/* ───── Cards / pillars ───────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background-color: #ffffff;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.4rem;
  box-shadow: 0 1px 3px rgba(27, 58, 92, 0.06);
}

.card h3 {
  color: #1B3A5C;
  border-bottom: 2px solid #D4A843;
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* ───── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
  background-color: #1B3A5C;
  color: #F5F0E1;
  border: 2px solid #1B3A5C;
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: #D4A843;
  border-color: #D4A843;
  color: #1B3A5C;
}

.btn--ghost {
  background-color: transparent;
  color: #1B3A5C;
  border: 2px solid #1B3A5C;
}

.btn--ghost:hover,
.btn--ghost:focus {
  background-color: #1B3A5C;
  color: #F5F0E1;
}

.cta-row {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ───── Lists with icons (purpose, objectives) ────────────────────────── */

.objectives {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.objectives li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.8rem;
}

.objectives li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.05rem;
  color: #D4A843;
  font-size: 0.9rem;
}

/* ───── Committee table ───────────────────────────────────────────────── */

.committee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.committee-card {
  background-color: #ffffff;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 6px;
  padding: 1.2rem;
  text-align: center;
}

.committee-card .role {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #D4A843;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.committee-card .name {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: #1B3A5C;
  margin: 0;
}

/* ───── Local information tables ──────────────────────────────────────── */

.info-block {
  background-color: #ffffff;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.info-block h3 {
  margin-top: 0;
  border-bottom: 2px solid #D4A843;
  padding-bottom: 0.5rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.5rem;
}

.info-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(27, 58, 92, 0.08);
  vertical-align: top;
}

.info-table td:first-child {
  font-weight: 600;
  color: #1B3A5C;
  width: 60%;
}

.info-table td:last-child {
  text-align: right;
  font-family: Georgia, serif;
  color: rgba(27, 58, 92, 0.85);
}

.info-table tr:last-child td {
  border-bottom: none;
}

/* ───── News and events ───────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  color: rgba(27, 58, 92, 0.6);
  font-style: italic;
  padding: 3rem 1rem;
  background-color: #ffffff;
  border: 1px dashed rgba(27, 58, 92, 0.2);
  border-radius: 6px;
  margin-top: 2rem;
}

.news-list,
.events-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.news-item,
.event-item {
  background-color: #ffffff;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 6px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1rem;
}

.news-item .meta,
.event-item .meta {
  display: block;
  font-size: 0.8rem;
  color: #D4A843;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.news-item h3,
.event-item h3 {
  margin: 0 0 0.5rem;
}

/* ───── Documents list ────────────────────────────────────────────────── */

.docs-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.docs-list li {
  background-color: #ffffff;
  border: 1px solid rgba(27, 58, 92, 0.1);
  border-radius: 6px;
  padding: 1rem 1.4rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.docs-list .doc-info h4 {
  margin: 0 0 0.2rem;
  color: #1B3A5C;
}

.docs-list .doc-info p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(27, 58, 92, 0.7);
}

/* ───── Gallery grid ──────────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(27, 58, 92, 0.1);
}

/* ───── Footer ────────────────────────────────────────────────────────── */

.site-footer {
  background-color: #1B3A5C;
  color: #F5F0E1;
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h4 {
  color: #D4A843;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 0.6rem;
}

.site-footer p,
.site-footer a {
  color: #F5F0E1;
  font-size: 0.9rem;
  margin: 0.2rem 0;
}

.site-footer a {
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 240, 225, 0.3);
}

.site-footer a:hover {
  color: #D4A843;
  border-bottom-color: #D4A843;
}

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 225, 0.2);
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.footer-bottom .legal a {
  margin-left: 1rem;
}

/* ───── Utility classes ───────────────────────────────────────────────── */

.text-center { text-align: center; }
.muted { color: rgba(27, 58, 92, 0.65); }
.small { font-size: 0.85rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
