/* ==========================================================================
   Astell Street et al Residents Association — Stylesheet
   ========================================================================== */

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

:root {
  --primary-dark: #2c3e50;
  --accent-red: #c0392b;
  --secondary-dark: #34495e;
  --highlight-beige: #f8f0e3;
  --info-blue: #e8f4f8;
  --background: #f9f7f4;
  --white: #ffffff;
  --shadow-sm: 0 2px 5px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-card: 0 3px 15px rgba(0,0,0,0.08);
  --shadow-card-hover: 0 8px 25px rgba(0,0,0,0.15);
  --radius: 8px;
  --max-width: 1100px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--primary-dark);
  background-color: var(--background);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

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

/* ==========================================================================
   HEADER — Hero image background
   ========================================================================== */
.site-header {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('images/astell-street.jpg') center/cover no-repeat;
  color: var(--white);
  text-align: center;
  overflow: hidden;
}

.site-header--compact {
  min-height: 260px;
}

.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(44,62,80,0.88) 0%, rgba(52,73,94,0.82) 100%);
}

.header-content {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem 2.5rem;
}

.site-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.site-header .subtitle {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.85;
  font-style: italic;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.site-nav {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding: 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-nav a {
  display: block;
  padding: 1rem 1.3rem;
  font-size: 0.95rem;
  color: var(--primary-dark);
  transition: color 0.25s ease;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0.5rem;
  left: 1.3rem;
  right: 1.3rem;
  height: 2px;
  background: var(--accent-red);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a.nav-active {
  color: var(--accent-red);
}

.site-nav a:hover::after,
.site-nav a.nav-active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  color: var(--primary-dark);
  width: 100%;
  text-align: right;
}

.nav-admin-link {
  margin-left: auto;
}

.nav-admin-link a {
  font-size: 0.8rem !important;
  opacity: 0.5;
  padding: 1rem 0.8rem !important;
}

.nav-admin-link a:hover { opacity: 1; }

/* ==========================================================================
   CTA BANNER
   ========================================================================== */
.cta-banner {
  background: var(--highlight-beige);
  border-bottom: 3px solid var(--accent-red);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  text-align: center;
}

.cta-inner p { font-size: 1.05rem; color: var(--primary-dark); }

.cta-button {
  display: inline-block;
  background: var(--accent-red);
  color: var(--white) !important;
  padding: 0.55rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  margin-left: 1rem;
  transition: background 0.25s ease, transform 0.15s ease;
}

.cta-button:hover {
  background: #a93226;
  transform: translateY(-1px);
}

/* ==========================================================================
   PHOTO BREAKS — full-width parallax-style image bands
   ========================================================================== */
.photo-break {
  height: 320px;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.photo-break--short {
  height: 220px;
}

/* Disable fixed attachment on touch / mobile — it's janky */
@supports (-webkit-overflow-scrolling: touch) {
  .photo-break { background-attachment: scroll; }
}
@media (hover: none) {
  .photo-break { background-attachment: scroll; }
}

/* ==========================================================================
   SECTIONS & CONTENT BOXES
   ========================================================================== */
.section {
  padding: 3.5rem 0;
}

.section-heading {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1.8rem;
  display: inline-block;
}

.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent-red);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.content-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.content-box h3 {
  font-size: 1.3rem;
  color: var(--secondary-dark);
  margin-bottom: 1rem;
}

.content-box p { margin-bottom: 1rem; }
.content-box p:last-child { margin-bottom: 0; }

.highlight-box {
  background: var(--highlight-beige);
  border-left: 4px solid var(--accent-red);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.highlight-box h3 {
  font-size: 1.3rem;
  color: var(--secondary-dark);
  margin-bottom: 0.75rem;
}

.highlight-box p { margin-bottom: 0.5rem; }

.info-box {
  background: var(--info-blue);
  border-left: 4px solid #3498db;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.info-box strong { color: var(--secondary-dark); }
.info-box p { margin-bottom: 0.75rem; }
.info-box p:last-child { margin-bottom: 0; }

/* --- Lists --- */
.streets-list {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
  margin-top: 0.5rem;
}

.streets-list li {
  padding: 0.3rem 0 0.3rem 1.2rem;
  position: relative;
  break-inside: avoid;
}

.streets-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.75rem;
  width: 6px; height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
}

.objects-list {
  list-style: none;
  padding: 0;
  margin-top: 0.75rem;
}

.objects-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  line-height: 1.6;
}

.objects-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-weight: 700;
}

/* ==========================================================================
   MEMBERSHIP CARDS
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

.card h3 {
  font-size: 1.3rem;
  color: var(--secondary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-red);
}

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

.agenda-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.agenda-list li {
  padding: 0.25rem 0 0.25rem 1.2rem;
  position: relative;
}

.agenda-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-red);
  font-weight: 700;
}

/* ==========================================================================
   MAP
   ========================================================================== */
.map-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.map-wrapper iframe {
  display: block;
  width: 100%;
  height: 400px;
}

/* ==========================================================================
   NEIGHBOURHOOD GALLERY — small watercolour thumbnails
   ========================================================================== */
.neighbourhood-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 4 / 3;
}

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

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

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-form { margin-top: 1.25rem; }

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

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  color: var(--secondary-dark);
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  color: var(--primary-dark);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.form-group textarea { resize: vertical; }

.form-submit {
  display: inline-block;
  background: var(--accent-red);
  color: var(--white);
  border: none;
  padding: 0.7rem 2rem;
  border-radius: 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.form-submit:hover {
  background: #a93226;
  transform: translateY(-1px);
}

.contact-address {
  font-style: normal;
  margin: 1rem 0;
  line-height: 1.8;
}

.contact-email {
  color: var(--accent-red);
  font-weight: 700;
  transition: opacity 0.2s;
}

.contact-email:hover { opacity: 0.75; }

/* ==========================================================================
   CONSTITUTION PAGE
   ========================================================================== */
.constitution {
  max-width: 820px;
}

.constitution-preamble {
  font-style: italic;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
  color: var(--secondary-dark);
}

.const-rule {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.const-rule:last-of-type {
  border-bottom: none;
}

.const-rule h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.rule-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--accent-red);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.const-rule p {
  margin-bottom: 0.6rem;
}

.const-sub {
  margin: 0.5rem 0 0 2.3rem;
  padding: 0;
}

.const-sub li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.back-link {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

.back-link a {
  color: var(--accent-red);
  font-weight: 700;
  transition: opacity 0.2s;
}

.back-link a:hover { opacity: 0.75; }

/* ==========================================================================
   NEWS PAGE — Public (compact card grid)
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
}

.news-card-image {
  position: relative;
  overflow: hidden;
  background: #f4f1ec;
  height: 220px;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.06);
}

.news-pdf-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent-red);
  color: var(--white);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.news-card-body {
  padding: 1.2rem;
}

.news-date {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.news-title {
  font-size: 1.1rem;
  color: var(--primary-dark);
  line-height: 1.35;
  margin: 0;
}

/* News detail page */
.news-detail-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  position: relative;
}

.news-detail-image img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
}

.news-detail-body {
  line-height: 1.8;
  font-size: 1.05rem;
}

.news-detail-body p { margin-bottom: 1rem; }

.news-detail-meta {
  font-size: 0.9rem;
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.news-pdf-link {
  display: inline-block;
  color: var(--accent-red);
  font-weight: 700;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 1px;
  transition: opacity 0.2s;
  margin-top: 1rem;
}

.news-pdf-link:hover { opacity: 0.7; }

/* Password change section in admin */
.admin-settings {
  margin-top: 2.5rem;
}

.admin-settings .content-box {
  max-width: 440px;
}

/* ==========================================================================
   ADMIN PAGE
   ========================================================================== */
.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-error {
  color: var(--accent-red);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.admin-success {
  color: #27ae60;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  background: var(--background);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone--active {
  border-color: var(--accent-red);
  background: var(--highlight-beige);
}

.drop-zone-prompt {
  color: var(--secondary-dark);
}

.drop-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.drop-zone-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.drop-zone-preview img {
  max-height: 220px;
  max-width: 100%;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.clear-file-btn {
  background: var(--accent-red);
  color: var(--white);
  border: none;
  padding: 0.35rem 1rem;
  border-radius: 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.clear-file-btn:hover { background: #a93226; }

/* Admin news list */
.admin-news-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.admin-news-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.admin-news-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.edit-btn,
.delete-btn {
  color: var(--white);
  border: none;
  padding: 0.4rem 1.2rem;
  border-radius: 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.edit-btn { background: #2980b9; }
.edit-btn:hover { background: #2471a3; }
.delete-btn { background: var(--accent-red); }
.delete-btn:hover { background: #a93226; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: var(--white);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.site-footer p { margin-bottom: 0.25rem; opacity: 0.85; }
.site-footer .copyright { opacity: 1; font-weight: 700; }
.site-footer a { color: rgba(255,255,255,0.9); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--white); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .site-header h1 {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
  }

  .site-header .subtitle { font-size: 0.95rem; }
  .site-header { min-height: 280px; }
  .site-header--compact { min-height: 200px; }

  .section-heading { font-size: 1.5rem; }

  .nav-toggle { display: block; }

  .site-nav ul {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.5rem;
  }

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

  .site-nav a {
    padding: 0.75rem 1.5rem;
    text-align: center;
  }

  .site-nav a::after { display: none; }

  .cta-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cta-button { margin-left: 0; }

  .photo-break { height: 200px; }
  .photo-break--short { height: 150px; }

  .streets-list { columns: 1; }
  .cards-grid { grid-template-columns: 1fr; }
  .neighbourhood-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .map-wrapper iframe { height: 280px; }

  .content-box,
  .highlight-box,
  .info-box { padding: 1.25rem; }

  /* News responsive */
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card-image {
    height: 240px;
  }

  .nav-admin-link { margin-left: 0; }

  /* Admin responsive */
  .admin-news-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .neighbourhood-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
