/* === Shire Wedding Theme === */

:root {
  --green-dark: #2f4f2f;
  --green-light: #7a9e7e;
  --gold: #c2a45a;
  --parchment: #f8f3e7;
}

/* Global layout fixes */
html, body {
  overflow-x: hidden; /* prevents iPhone horizontal scrolling */
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Lora', serif;
  background-color: var(--parchment);
  color: var(--green-dark);
  background-image: url('./images/shire_orange_lights.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* works on desktop; overridden on iOS */
}

/* Fix iOS Safari background bug */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll !important;
  }
}

header {
  text-align: center;
  padding: 1rem 1rem 1rem;
  border-bottom: 2px solid var(--gold);
  background-color: rgb(198 220 203 / 85%);
}

h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 2.5rem;
  margin-bottom: 0.2rem;
  color: var(--green-dark);
}

.subtitle {
  font-style: italic;
  color: var(--green-light);
}

nav {
  margin-top: 1rem;
}

nav a {
  text-decoration: none;
  color: var(--green-dark);
  margin: 0 1rem;
  font-weight: bold;
  font-family: 'Cinzel Decorative', cursive;
  transition: color 0.3s;
}

nav a:hover,
nav a.active {
  color: var(--gold);
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgb(198 220 203 / 85%);
  border: 1px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow-x: hidden; /* prevents SPA transitions from creating overflow */
}

section h2 {
  font-family: 'Cinzel Decorative', cursive;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.3rem;
  color: var(--green-dark);
  text-align: center;
}

.divider {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: auto;
  max-width: 80%;      /* allows responsive shrinking */
  height: auto;
  opacity: 0.8;
}

/* Unordered list rules */
ul {
  list-style: none;
  padding: 0.1rem;
}

ul li {
  margin-bottom: 0.2rem;
}

/* === Sublist with leaf bullets === */
.sublist {
  padding: 0.2rem 0 0.2rem 0;
}

.sublist li {
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1.2rem;
}

.sublist li::before {
  content: "🍃";
  position: absolute;
  left: 0;
  top: 0;
}

/* Form fields */
label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.3rem;
  font-family: 'Lora', serif;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background-color: #fffaf0;
}

button {
  background-color: var(--green-dark);
  color: white;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background-color 0.3s;
}

button:hover {
  background-color: var(--green-light);
}

footer {
  text-align: center;
  padding: 1rem;
  border-top: 2px solid var(--gold);
  font-style: italic;
  background-color: rgb(198 220 203 / 85%);
}

.hidden {
  display: none;
}

#responseMessage {
  margin-top: 1rem;
  font-weight: bold;
  color: var(--green-dark);
  text-align: center;
}

/* === Smooth content transitions for SPA === */
#content {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#content.active {
  opacity: 1;
  transform: translateX(0);
}

#content.exit {
  opacity: 0;
  transform: translateX(-40px);
}

/* === Timeline === */
.timeline ul {
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  margin-top: 1rem;
}

.timeline li {
  display: block;
  border-left: 3px solid var(--green-dark);
  padding-left: 10px;
  min-height: 30px;
}

.timeline li::before {
  content: "";
  width: 12px;
  height: 12px;
  background-color: var(--green-dark);
  display: inline-block;
  border-radius: 6px;
  position: relative;
  margin-left: -17px;
  margin-right: 10px;
  margin-top: 3px;
}

/* === Map Section === */
.map-section {
  margin-top: 3rem;
  text-align: center;
}

.map-section h2 {
  margin-bottom: 0.5rem;
}

.map-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--gold);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.map-container iframe {
  width: 100%;
  height: 350px;
  border: none;
}

/* === Door reveal animation === */
.door-link {
  display: block;
  width: 100%;
  text-decoration: none;
}

.door-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  margin: 2rem auto;
  cursor: pointer;
  transform-origin: center;
}

.door-container .door {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.6s ease-in-out;
}

.door-container .door.closed {
  opacity: 1;
}

.door-container .door.open {
  opacity: 0;
}

/* Hover effect */
.door-container:hover .door.closed {
  opacity: 0;
}

.door-container:hover .door.open {
  opacity: 1;
}

/* Prevent iPhone from overflowing during scale animation */
.door-container:hover {
  transform: scale(1.02);
  transition: transform 0.4s ease;
  overflow: hidden;
}

/* === Inline link styling === */
.inline-link {
  color: var(--green-dark);
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.inline-link:hover {
  color: var(--gold);
}

/* === Icon buttons === */
.with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.with-icon .icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.poem {
  text-align: center;
}
