/* =============================================
   Dunsyre.net — Stylesheet
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #2c2c2c;
  background: #faf9f6;
  line-height: 1.75;
  animation: pageIn 0.4s ease both;
}

body.page-exit {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes pageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Georgia', serif;
  font-weight: normal;
  color: #1a2e1a;
  line-height: 1.3;
}

h1 { font-size: 2.4rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.7rem; margin-bottom: 1rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }

p { margin-bottom: 1.2rem; }

a {
  color: #3a6b3a;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Layout --- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header / Nav --- */
header {
  background: #1a2e1a;
  color: #f0ede4;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.5rem;
  color: #f0ede4;
  font-family: 'Georgia', serif;
  letter-spacing: 0.03em;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-subtitle {
  font-size: 0.8rem;
  color: #a8c0a8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: #c8dcc8;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

nav a:hover,
nav a.active {
  color: #f0ede4;
  text-decoration: none;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #2d4a2d 0%, #1a2e1a 60%, #0f1f0f 100%);
  color: #f0ede4;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(80,120,60,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(60,100,40,0.15) 0%, transparent 50%);
  animation: heroPulse 9s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 70%, rgba(100,150,60,0.12) 0%, transparent 55%);
  animation: heroPulse 12s ease-in-out infinite reverse;
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.5; transform: scale(1);    }
  50%       { opacity: 1;   transform: scale(1.08); }
}

.hero-content {
  position: relative;
  z-index: 1;
  transition: transform 0.1s linear, opacity 0.1s linear;
}

.hero h1 {
  color: #f0ede4;
  font-size: 3rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  animation: heroTitleIn 0.9s cubic-bezier(0.22,1,0.36,1) 0.2s both;
}

.hero .tagline {
  font-size: 1.1rem;
  color: #a8c0a8;
  font-style: italic;
  margin-bottom: 0;
  animation: heroTitleIn 0.9s cubic-bezier(0.22,1,0.36,1) 0.45s both;
}

@keyframes heroTitleIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Page header (inner pages) --- */
.page-header {
  background: #2d4a2d;
  color: #f0ede4;
  padding: 3rem 1.5rem 2.5rem;
}

.page-header h1 {
  color: #f0ede4;
  margin-bottom: 0.4rem;
}

.page-header .subtitle {
  color: #a8c0a8;
  font-style: italic;
  font-size: 1rem;
}

/* --- Main content --- */
main {
  padding: 3rem 0 4rem;
}

/* --- Cards (homepage) --- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  background: #fff;
  border: 1px solid #ddd8cc;
  border-radius: 4px;
  padding: 1.75rem 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.card h3 {
  margin-top: 0;
  color: #1a2e1a;
  font-size: 1.1rem;
}

.card p {
  font-size: 0.92rem;
  color: #555;
  margin-bottom: 1rem;
}

.card a.btn {
  display: inline-block;
  background: #3a6b3a;
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}

.card a.btn:hover {
  background: #2d5430;
  text-decoration: none;
}

/* --- Intro block --- */
.intro {
  font-size: 1.05rem;
  color: #444;
  max-width: 680px;
  margin-bottom: 0.5rem;
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid #ddd8cc;
  margin: 2.5rem 0;
}

/* --- Pull quote --- */
blockquote {
  border-left: 3px solid #3a6b3a;
  padding: 0.5rem 1.25rem;
  margin: 2rem 0;
  color: #555;
  font-style: italic;
}

/* --- Info box --- */
.info-box {
  background: #f0f5f0;
  border: 1px solid #c8dcc8;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.93rem;
}

.info-box h3 {
  margin-top: 0;
  color: #2d4a2d;
  font-size: 1rem;
}

/* --- Footer --- */
footer {
  background: #1a2e1a;
  color: #7a9a7a;
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
}

footer a {
  color: #a8c0a8;
}

/* --- Stations table --- */
.stations-table {
  margin: 1.25rem 0 1.75rem;
  overflow-x: auto;
}

.stations-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.stations-table th {
  background: #2d4a2d;
  color: #f0ede4;
  text-align: left;
  padding: 0.6rem 1rem;
  font-weight: normal;
  letter-spacing: 0.03em;
}

.stations-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #ddd8cc;
  vertical-align: top;
}

.stations-table tbody tr:nth-child(even) {
  background: #f5f3ee;
}

.stations-table tbody tr:hover {
  background: #edf2ed;
}

/* =============================================
   Animations
   ============================================= */

/* --- Scroll fade-up (general content) --- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.fade-up:nth-child(2) { transition-delay: 0.08s; }
.fade-up:nth-child(3) { transition-delay: 0.16s; }

/* --- Nav link hover underline animation --- */
nav a {
  position: relative;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: #f0ede4;
  transition: width 0.25s ease;
}
nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* =============================================
   History Timeline
   ============================================= */
.timeline {
  position: relative;
  padding-left: 2.25rem;
  margin-top: 0.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(to bottom, #c8dcc8 0%, #3a6b3a 30%, #3a6b3a 70%, #c8dcc8 100%);
}

.timeline-entry {
  position: relative;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-entry.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Dot on the timeline line */
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -2.6rem;
  top: 0.5rem;
  width: 0.85rem;
  height: 0.85rem;
  background: #faf9f6;
  border: 2px solid #3a6b3a;
  border-radius: 50%;
  transition: background 0.3s ease;
  z-index: 1;
}

.timeline-entry.is-visible::before {
  background: #3a6b3a;
  box-shadow: 0 0 0 3px rgba(58,107,58,0.18);
}

/* Year/era badge */
.timeline-era {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #3a6b3a;
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  margin-bottom: 0.4rem;
}

/* Sources box at bottom — outside timeline */
.sources-box {
  margin-top: 2rem;
  padding-left: 0;
}

/* =============================================
   Photo figures
   ============================================= */
.photo-figure {
  margin: 2rem 0;
  line-height: 0;
}

.photo-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  background: #e0ddd5; /* placeholder tint while image loads */
  min-height: 220px;
  object-fit: cover;
}

.photo-figure figcaption {
  font-size: 0.82rem;
  color: #777;
  font-style: italic;
  line-height: 1.4;
  padding: 0.5rem 0.25rem 0;
}

.photo-credit {
  display: block;
  font-style: normal;
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.2rem;
}

/* Two-column photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.photo-grid .photo-figure {
  margin: 0;
}

/* Full-width banner photo */
.photo-banner {
  margin: 2.5rem 0;
  line-height: 0;
}

.photo-banner img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  background: #e0ddd5;
}

.photo-banner figcaption {
  font-size: 0.82rem;
  color: #777;
  font-style: italic;
  line-height: 1.4;
  padding: 0.5rem 0.25rem 0;
}

/* =============================================
   Hills / data tables
   ============================================= */
.hills-table {
  margin: 1.25rem 0 1.75rem;
  overflow-x: auto;
}

.hills-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.hills-table th {
  background: #2d4a2d;
  color: #f0ede4;
  text-align: left;
  padding: 0.6rem 1rem;
  font-weight: normal;
  letter-spacing: 0.03em;
}

.hills-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #ddd8cc;
  vertical-align: top;
}

.hills-table tbody tr:nth-child(even) {
  background: #f5f3ee;
}

/* =============================================
   Header weather (compact, all pages)
   ============================================= */
#header-weather {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(240,237,228,0.85);
  white-space: nowrap;
  margin-left: 1rem;
}
.hw-icon { font-size: 1rem; line-height: 1; }
.hw-temp { font-weight: 600; letter-spacing: 0.02em; }
.hw-desc { opacity: 0.75; }

/* =============================================
   Weather widget (full, index.html only)
   ============================================= */
.weather-widget {
  background: #fff;
  border: 1px solid #c8dcc8;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.weather-icon {
  font-size: 2.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.weather-main {
  flex: 1;
  min-width: 160px;
}

.weather-temp {
  font-size: 1.8rem;
  font-family: 'Georgia', serif;
  color: #1a2e1a;
  line-height: 1.1;
}

.weather-desc {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.15rem;
}

.weather-detail {
  font-size: 0.82rem;
  color: #777;
  margin-top: 0.3rem;
}

.weather-label {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a9a7a;
  margin-bottom: 0.25rem;
}

.weather-loading {
  color: #aaa;
  font-style: italic;
  font-size: 0.9rem;
}

/* =============================================
   Bird / wildlife lists
   ============================================= */
.wildlife-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 2rem;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.92rem;
  color: #444;
}

.wildlife-cols span::before {
  content: '–  ';
  color: #3a6b3a;
}

/* =============================================
   Dropdown navigation
   ============================================= */
nav li {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -0.75rem;
  background: #1f361f;
  min-width: 210px;
  z-index: 200;
  border-top: 2px solid #3a6b3a;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  list-style: none;
  padding: 0.5rem 0 0;
  margin: 0;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: block;
}

.dropdown li {
  display: block;
  width: 100%;
}

.dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: #c8dcc8;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.dropdown a:hover,
.dropdown a.active {
  background: #2d4a2d;
  color: #f0ede4;
  text-decoration: none;
}

.dropdown a::after {
  display: none !important;
}

/* =============================================
   History sub-page prev/next navigation
   ============================================= */
.history-subnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd8cc;
  font-size: 0.88rem;
}

.history-subnav a {
  color: #3a6b3a;
}

.history-subnav .subnav-centre {
  color: #aaa;
  font-size: 0.8rem;
}

/* =============================================
   Lightbox
   ============================================= */

/* Zoom cursor + hover hint on clickable images */
figure.photo-figure,
figure.photo-banner {
  position: relative;
}

figure.photo-figure img,
figure.photo-banner img {
  cursor: zoom-in;
}

figure.photo-figure::after,
figure.photo-banner::after {
  content: '⤢ click to enlarge';
  position: absolute;
  bottom: 2rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  line-height: 1;
}

figure.photo-figure:hover::after,
figure.photo-banner:hover::after {
  opacity: 1;
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.75;
  padding: 0;
}

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

.lightbox-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.45);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  pointer-events: none;
  white-space: nowrap;
  margin: 0;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  h1 { font-size: 1.9rem; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  #header-weather { display: none; }
  nav ul { gap: 1rem; }
  .timeline { padding-left: 1.5rem; }
  .timeline-entry::before { left: -1.85rem; }
  .photo-grid { grid-template-columns: 1fr; }
  .wildlife-cols { grid-template-columns: 1fr; }
  .photo-banner img { height: 200px; }
  .weather-widget { flex-direction: column; gap: 0.75rem; }
  .history-subnav { flex-direction: column; gap: 0.75rem; text-align: center; }
  .dropdown {
    position: absolute;
    display: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    border-radius: 0 0 3px 3px;
    min-width: 210px;
  }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown {
    display: block;
  }
}
