/* ============================================================
   OORPARTY.SCOT - Design System
   Colors: Red #da524c · Cream #f9f5e7 · Black #000
   Fonts:  Anton (headings) · Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #da524c;
  --cream: #f9f5e7;
  --black: #000000;
  --white: #ffffff;
  --gray-100: #f3f0e3;
  --gray-200: #e0dcc8;
  --gray-400: #999;
  --gray-600: #555;
  --red-dark: #b83e39;
  --red-light: #f4a09c;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .08);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, .14);
  --transition: .25s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--black);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--red-dark);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--red);
  color: var(--white);
  padding: .5rem 1rem;
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Focus states ---------- */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: 'Anton', Impact, sans-serif;
  font-weight: 400;
  /* Anton only has 400 */
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--black);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-bottom: .75rem;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  margin-bottom: .5rem;
}

h4 {
  font-size: 1.1rem;
  margin-bottom: .4rem;
}

p {
  margin-bottom: 1.5rem;
}

ul,
ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: .5rem;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 7rem 0 3rem;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--black);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-logo {
  font-family: 'Anton', sans-serif;
  font-size: 1.5rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Brand name two-color rendering */
.brand-main {
  color: #ffffff;
}

.brand-domain {
  color: #0065BD;
}

/* ---- Nav ---- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}

.nav-toggle .bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--cream);
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: .25rem;
  padding: 0;
  margin: 0;
}

.main-nav a {
  color: var(--cream);
  padding: .5rem .75rem;
  font-weight: 500;
  font-size: .9rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--red);
  color: var(--white);
}

/* ---------- Hero (Home page) ---------- */
.hero {
  background: var(--black);
  color: var(--cream);
  padding: 3.5rem 0 6rem;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin-bottom: 1rem;
  -webkit-mask-image: linear-gradient(-75deg, rgba(0, 0, 0, 0.8) 30%, #000 50%, rgba(0, 0, 0, 0.8) 70%);
  mask-image: linear-gradient(-75deg, rgba(0, 0, 0, 0.8) 30%, #000 50%, rgba(0, 0, 0, 0.8) 70%);
  -webkit-mask-size: 200%;
  mask-size: 200%;
  animation: shine 5s linear infinite;
}

.hero h1 span {
  color: var(--red);
}

.hero p {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto 2rem;
  color: var(--gray-200);
}

.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .85rem 2rem;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  border: none;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: var(--gray-600);
  color: var(--white);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 2px solid var(--cream);
}

.btn-outline:hover {
  background: var(--cream);
  color: var(--black);
  border-color: var(--cream);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* ---------- Homepage dynamic sections ---------- */
.home-updates,
.next-event {
  margin-top: 1.5rem;
}

.next-event {
  margin-bottom: 1.5rem;
}

.event-highlight {
  padding: 2rem;
  background: var(--white);
  border-left: 6px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow);
}

.event-highlight h3 {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  font-size: 1.4rem;
  margin-bottom: .5rem;
}

.event-highlight p {
  margin-bottom: .75rem;
}

.event-highlight .btn {
  margin-top: 2rem;
}

/* ---------- Photo Carousel ---------- */
.photo-carousel-wrap {
  margin: 1.5rem 0;
}

.carousel-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* Edge Fade Indicators */
.carousel-container::before,
.carousel-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 1rem;
  /* match padding-bottom of .photo-carousel */
  width: 60px;
  z-index: 5;
  pointer-events: none;
  transition: opacity var(--transition);
  opacity: 0;
}

.carousel-container::before {
  left: 1.5rem;
  /* match container padding */
  background: linear-gradient(to right, var(--black), transparent);
}

.carousel-container::after {
  right: 1.5rem;
  /* match container padding */
  background: linear-gradient(to left, var(--black), transparent);
}

.carousel-container.show-fade-left::before {
  opacity: 1;
}

.carousel-container.show-fade-right::after {
  opacity: 1;
}

.photo-carousel {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  scroll-behavior: smooth;
  padding-bottom: 1rem;
  padding-right: 1.5vw;
  /* Extra padding gives the last image room to scale without triggering a shift */
  width: 100%;
}

.photo-carousel img {
  flex: 0 0 auto;
  height: 200px;
  width: auto;
  border-radius: 6px;
  scroll-snap-align: start;
  transition: transform var(--transition);
}

.photo-carousel img:hover {
  transform: scale(1.02);
  z-index: 11;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.5rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  opacity: 0.85;
  z-index: 20;
  border-radius: 4px;
  transition: opacity var(--transition);
}

.carousel-btn:hover:not(:disabled) {
  opacity: 1;
}

.carousel-btn:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

.carousel-left {
  left: -10px;
}

.carousel-right {
  right: -10px;
}

.photo-carousel::-webkit-scrollbar {
  height: 8px;
}

.photo-carousel::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}

.photo-carousel::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 10px;
}

.photo-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Event Card Accent */
.card-event {
  border-left: 5px solid var(--red);
}

/* Update Card Accent (More subtle) */
.card-update {
  border-left: 5px solid var(--red);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-date {
  font-size: .8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
  font-weight: 600;
}

.card-title {
  font-family: 'Anton', sans-serif;
  font-size: 1.3rem;
  text-transform: uppercase;
  margin-bottom: .5rem;
  line-height: 1.2;
}

.card-title a {
  color: var(--black);
}

.card-title a:hover {
  color: var(--red);
}

.card-excerpt {
  color: var(--gray-600);
  font-size: .95rem;
  flex: 1;
  margin-bottom: 1rem;
}

.card-link {
  font-weight: 600;
  font-size: .9rem;
  color: var(--red);
  align-self: flex-start;
}

.card-link::after {
  content: ' →';
}

/* ---------- Markdown content area ---------- */
.markdown-body {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  line-height: 1.75;
  font-size: 1.125rem;
  color: #222;
}

.markdown-body h1 {
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.markdown-body h2 {
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.markdown-body h3 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.markdown-body p,
.markdown-body blockquote,
.markdown-body table {
  margin-bottom: 2rem;
}

.markdown-body ul,
.markdown-body ol {
  text-align: center;
  list-style-position: inside;
  margin-bottom: 2rem;
  padding-left: 0;
}

.markdown-body li {
  margin-bottom: 1rem;
}

.markdown-body blockquote {
  border-left: 4px solid var(--red);
  margin: 2rem auto;
  padding: 1rem 1.5rem;
  background: var(--gray-100);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 90%;
  text-align: left;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.markdown-body th,
.markdown-body td {
  padding: .75rem 1rem;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.markdown-body th {
  background: var(--black);
  color: var(--cream);
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  font-weight: 400;
}

.markdown-body code {
  background: var(--gray-100);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .9em;
}

.markdown-body pre {
  background: var(--black);
  color: var(--cream);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.markdown-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.markdown-body a {
  text-decoration: underline;
}

.markdown-body a:hover {
  color: var(--red-dark);
}

/* ---------- Detail page ---------- */
.detail-meta {
  font-size: .85rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.detail-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.detail-back::before {
  content: '← ';
}

/* ---------- Error box ---------- */
.error-box {
  background: #fff3f3;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

.error-box h2 {
  color: var(--red);
}

/* ---------- Page Header banner ---------- */
.page-header {
  background: var(--black);
  color: var(--cream);
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.page-header h1 {
  color: var(--white);
  margin-bottom: .5rem;
}

.page-header p {
  color: var(--gray-200);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: var(--gray-200);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--gray-200);
  font-size: .9rem;
}

.footer-links a:hover {
  color: var(--red);
}

.footer-copy {
  font-size: .85rem;
  color: var(--gray-400);
}

/* ---------- Form Status Messages ---------- */
.status-msg {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-msg.success {
  background: #e7f6e7;
  color: #1e4620;
  border: 1px solid #c3e6cb;
}

.status-msg.error {
  background: #fdf2f2;
  color: #9b2c2c;
  border: 1px solid #f8d7da;
}

/* ---------- Unsubscribe Page Specific ---------- */
.unsubscribe-form {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-radio-group-wrap {
  margin: 1.5rem 0;
}

.form-radio-group-wrap p {
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: left;
}

.form-radio-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.form-radio-group input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--red);
}

.form-radio-group label {
  font-size: 1rem;
  cursor: pointer;
}

.volunteer-form-wrap {
  margin: 1.5rem auto 4rem;
  max-width: 700px;
}

/* ---------- Loading spinner ---------- */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--gray-400);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-left: .75rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shine {
  from {
    -webkit-mask-position: 150%;
    mask-position: 150%;
  }
  to {
    -webkit-mask-position: -50%;
    mask-position: -50%;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  }

  .main-nav.open {
    max-height: 500px;
  }

  .main-nav ul {
    flex-direction: column;
    padding: .75rem 1.5rem 1rem;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: .65rem 0;
    border-bottom: 1px solid rgba(249, 245, 231, .1);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Forms ---------- */
.signup-form {
  max-width: 580px;
  margin: 1.5rem auto 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.hero .signup-form {
  max-width: 800px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.signup-form h3 {
  color: inherit;
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  font-family: 'Anton', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.signup-form .supporting-text {
  font-size: 0.88rem;
  margin-bottom: 1rem;
  opacity: 0.9;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  font-family: inherit;
  font-size: 0.95rem;
}

.hero .form-input {
  background: var(--white);
  border-color: transparent;
}

.form-checkbox-group {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.form-checkbox-group input[type='checkbox'] {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.form-checkbox-group label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  cursor: pointer;
  margin-bottom: 0;
}

.signup-form .form-disclaimer {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0 1.5rem;
  opacity: 1;
  line-height: 1.45;
  color: inherit;
  text-align: center;
}

.signup-form .btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

/* Light background form adjustments (Get Involved page) */
.markdown-body .signup-form {
  max-width: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: var(--white);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.markdown-body .signup-form h3,
.markdown-body .signup-form label,
.markdown-body .signup-form .supporting-text {
  color: var(--cream);
}

.markdown-body .form-input {
  background: var(--white);
  border: 1px solid var(--gray-200);
}

@media (max-width: 480px) {
  .signup-form {
    padding: 1rem;
  }
}

/* Homepage content centering */
[data-page="home"] main,
#home-details {
  text-align: center;
  padding: 1.5rem 0;
}

[data-page="home"] main ul,
[data-page="home"] main ol,
#home-details ul,
#home-details ol {
  list-style-type: none;
  padding-left: 0;
  text-align: center;
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .status-msg,
  .loading::after,
  .btn,
  .card,
  .photo-carousel img,
  .nav-toggle .bar,
  a {
    animation: none !important;
    transition: none !important;
  }
  
  html {
    scroll-behavior: auto !important;
  }
}
