/*
Theme Name: Sprezzatura
Theme URI: https://sprezzatura-fencing.ch
Description: Custom theme for Sprezzatura Historical Fencing Geneva
Author: Sprezzatura
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: sprezzatura
*/

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: 'Playfair Display', serif;
  background-color: #313338;
  color: #f5f5f5;
  font-size: clamp(1rem, 1.5vw, 1.5rem);
}

/* =====================
   NAVIGATION
===================== */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 2rem;
  background-color: rgb(104, 2, 2);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

nav.scrolled {
  background-color: rgb(104, 2, 2);
  height: 80px;
  padding: 0 2rem;
}

nav.menu-open {
  background-color: rgb(104, 2, 2);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.33s linear, transform 0.03s linear;
}

nav.menu-open.scroll-fade {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Inner wrapper — centred horizontal group */
.nav-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 1200px;
}

/* Logo sits inline with the nav links */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0 1.5rem;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img,
.logo .custom-logo {
  height: 60px;
  width: 60px;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}

/* Nav links — horizontal, centred, all caps */
.nav-links {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: inline-block;
}

.nav-links a {
  color: #f5f5f5;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease-in-out;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #f5f5f5;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-links svg:hover {
  transform: scale(1.1);
}

/* =====================
   BODY OFFSET FOR FIXED NAV
   Pushes page content below the fixed nav bar.
   Adjust if nav height changes.
===================== */

main {
  padding-top: 80px; /* Must match nav height above exactly */
  padding-left: 15%;
  padding-right: 15%;
  box-sizing: border-box;
}

/* =====================
   COVER BLOCK — FULL WIDTH BREAKOUT
   Breaks the Cover block out of the 15% side padding
   so it stretches edge-to-edge across the screen.
   Works for both "full width" and "wide width" alignments
   set in the block editor.
===================== */

main .wp-block-cover,
main .wp-block-cover.alignfull,
main .wp-block-cover.alignwide {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-15vw + 2.35%);
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

main .wp-block-cover {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Content inside the Cover block stays readable and centred */
main .wp-block-cover .wp-block-cover__inner-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* =====================
   VIDEO BACKGROUND — NO OVERLAY
   Removes the dim/colour overlay that WordPress adds by default
   when a Cover block uses a video background.
===================== */

main .wp-block-cover:has(video) .wp-block-cover__background,
main .wp-block-cover:has(video)::after,
main .wp-block-cover:has(video)::before {
  display: none !important;
  opacity: 0 !important;
  background: none !important;
}

/* Also target the specific overlay class WordPress injects */
main .wp-block-cover:has(video) .wp-block-cover__gradient-background {
  display: none !important;
}

/* Video fills the section without cropping — no black bars */
main .wp-block-cover:has(video) video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  min-width: 100%;
  min-height: 100%;
}

main .wp-block-cover:has(video) {
  background-color: transparent;
  overflow: hidden;
}

/* =====================
   COLUMNS BLOCK — TEXT + IMAGE GRID
   Stretches to fill the full content area (up to the 15% padding).
   Each column takes 50% width with a comfortable gap.
   Images inside columns fill their container fully.
===================== */

/* Outer columns wrapper — fills the padded content area */
main .wp-block-columns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Each individual column */
main .wp-block-column {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Image block inside a column — fills the column width */
main .wp-block-column .wp-block-image {
  margin: 0;
  width: 100%;
}

main .wp-block-column .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* Image block that should fill full column height (no border radius needed) */
main .wp-block-column .wp-block-image.is-style-full-height img {
  border-radius: 0;
  max-height: 600px;
}

/* Paragraph / text content inside a column */
main .wp-block-column p {
  margin-top: 0;
}

main .wp-block-column h1,
main .wp-block-column h2,
main .wp-block-column h3 {
  margin-top: 0;
}

/* =====================
   RESPONSIVE — stack columns on mobile
===================== */
@media (max-width: 768px) {
  main .wp-block-columns {
    flex-direction: column;
    gap: 1.5rem;
  }

  main .wp-block-column {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  main .wp-block-column .wp-block-image img {
    max-height: 300px;
  }
}



h1 {
  font-family: 'Playfair Display', serif;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 6vw, 6rem);
  font-weight: 500;
  margin-bottom: 1rem;
  color: #f5f5f5;
  -webkit-text-fill-color: #f5f5f5;
  text-underline-offset: 6px;
  text-decoration: underline darkred;
  text-decoration-thickness: 6px;
}

h2 {
  font-family: 'Playfair Display', serif;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 4vw, 4rem);
  font-weight: 500;
  margin-bottom: 1rem;
  color: white;
  text-underline-offset: 6px;
  text-decoration: underline rgb(104, 2, 2);
  text-decoration-thickness: 6px;
}

h3 {
  font-family: 'Playfair Display';
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 1rem;
  padding: 0.5rem;
  color: #f5f5f5;
  -webkit-text-fill-color: #f5f5f5;
  background-color: rgb(104, 2, 2);
}

p {
  font-family: 'Playfair Display';
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  font-weight: 100;
  margin-bottom: 1rem;
  color: #f5f5f5;
  text-align: justify;
  line-height: 180%;
}

/* =====================
   LINKS
===================== */

a:link {
  color: white;
}

a:hover {
  color: darkred;
  text-decoration: underline;
}

a:active {
  color: darkred;
}

/* =====================
   HERO SECTION
===================== */

#hero-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 33%;
  color: white;
  background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    url('images/hero.jpg');
  background-size: cover;
  background-position: right;
  background-repeat: no-repeat;
}

/* =====================
   ABOUT / CONTENT SECTIONS
===================== */

#about1,
#about2,
#about3,
#about4 {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 2rem 10%;
  padding-top: 5%;
  color: #f5f5f5;
  box-sizing: border-box;
}

#training {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 2rem 10%;
  padding-top: 5%;
  color: #f5f5f5;
  box-sizing: border-box;
}

#contact {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 2rem 10%;
  padding-top: 5%;
  color: #f5f5f5;
  box-sizing: border-box;
}

/* =====================
   TRAINING LAYOUT
===================== */

.training-columns {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 1%;
}

.training-text,
.training-media {
  flex: 1;
  width: 50%;
}

.training-media {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.training-media2 {
  width: 0%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.training-media img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.training-article {
  display: block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
}

.training-article img {
  float: right;
  width: 60%;
  max-width: 500px;
  margin-left: 0;
  margin-bottom: 0;
  border-radius: 8px;
}

.training-offers table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(1rem, 3vw, 1.8rem);
  margin: 0;
  color: #f5f5f5;
}

.training-offers th,
.training-offers td {
  border: 1px solid #ccc;
  padding: 1rem;
  text-align: left;
}

.training-offers th {
  background-color: #2B303A;
  font-weight: bold;
}

.training-offers td {
  background-color: #1f1f1f;
}

/* =====================
   CTA BUTTON
===================== */

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #f5f5f5;
  background-color: #680202;
  border: 2px solid black;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 0.5rem 0.25rem 0.5rem 0;
}

.cta-button:hover {
  background-color: crimson;
  color: black;
  text-decoration: none;
}

/* =====================
   CONTACT SECTION
===================== */

.contact-section {
  font-family: 'Playfair Display', serif;
  padding: 2rem;
  background-color: #1f1f1f;
  color: #f5f5f5;
  text-align: left;
}

.contact-form {
  display: flex;
  flex-direction: column;
  width: 50%;
  max-width: 600px;
  margin: 0 auto;
  gap: 1rem;
}

.contact-form label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #f5f5f5;
  margin-bottom: 0.25rem;
  display: block;
  text-align: left;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid darkred;
}

.contact-form button {
  font-family: 'Playfair Display', serif;
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #f5f5f5;
  background-color: rgb(104, 2, 2);
  border: 2px solid black;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: crimson;
}

/* =====================
   FOOTER
===================== */

footer {
  text-align: center;
  padding: clamp(0.5rem, 4vw, 2rem);
  background-color: #111;
  color: white;
  font-size: 1rem;
}

footer a {
  color: white;
}

/* =====================
   SCROLL FADE ANIMATION
   .fade-ready = initial hidden state (set by JS on page load)
   .fade-visible = triggered by JS when element scrolls into view going down
   Elements above the fold start visible immediately.
===================== */

.fade-ready {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-ready.fade-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Legacy class kept for any manually assigned blocks */
.scroll-fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.scroll-fade.fade-visible,
.scroll-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================
   PAGE TRANSITION
===================== */

#transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(104, 2, 2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
  z-index: 9999;
}

#transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

body.fade-in {
  animation: fadeInFromRed 0.15s ease-in-out;
}

@keyframes fadeInFromRed {
  0% {
    background-color: rgb(104, 2, 2);
    opacity: 0;
  }
  100% {
    background-color: transparent;
    opacity: 1;
  }
}

/* =====================
   FAQ
===================== */

.faq-item {
  margin: 1em 0;
  border: 1px solid #ccc;
  padding: 1em;
  position: relative;
}

.toggle-btn {
  position: absolute;
  top: 1em;
  right: 1em;
  font-size: 1.5em;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease;
  color: #f5f5f5;
}

.toggle-btn[aria-expanded="true"] {
  transform: rotate(45deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.faq-content.open {
  max-height: 500px;
  opacity: 1;
}

/* =====================
   HAMBURGER / MOBILE NAV
===================== */

.hamburger {
  display: none;
  font-size: 1rem;
  background: none;
  border: none;
  color: #f5f5f5;
  cursor: pointer;
}

/* =====================
   UTILITY CLASSES
===================== */

.hide-on-mobile {
  display: block;
}

.show-on-mobile {
  display: none;
}

.container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 10%;
  box-sizing: border-box;
}

/* =====================
   RESPONSIVE — MOBILE
===================== */

@media (max-width: 768px) {

  h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    text-align: center;
  }

  h2 {
    font-size: clamp(1.25rem, 6vw, 2rem);
  }

  h3 {
    font-size: clamp(1.1rem, 5vw, 1.6rem);
  }

  p {
    font-size: clamp(0.95rem, 4vw, 1.25rem);
  }

  #hero-section {
    position: relative;
    width: 100vw;
    left: 0;
    margin: 0;
    padding: 25% 0% 95% 0%;
    background-position: 12.5% center;
    background-size: cover;
    box-sizing: border-box;
  }

  .logo {
    position: absolute;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    width: 51px;
    height: 51px;
    margin: 0;
    padding: 0;
  }

  .logo img,
  .logo .custom-logo {
    width: 51px;
    height: 51px;
  }

  .nav-links svg {
    width: 20px;
    height: 20px;
    padding-top: 10px;
    align-items: center;
  }

  .hamburger {
    display: block;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgb(104, 2, 2);
    padding: 2rem 1.5rem;
    gap: 1.25rem;
    min-height: 200px;
    height: auto;
    box-sizing: border-box;
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .training-columns {
    flex-direction: column;
    align-items: center;
  }

  .training-text,
  .training-media {
    width: 100%;
  }

  .training-media iframe {
    height: 400px;
    width: 100%;
  }

  .training-media2 {
    display: none;
  }

  .training-article img {
    float: none;
    display: block;
    width: 100%;
    margin: 1rem 0;
  }

  .training-article {
    float: none;
    display: block;
    width: 100%;
    margin: 1rem 0;
    padding-left: 0;
  }

  .cta-button {
    font-size: clamp(1rem, 2vw, 3rem);
    margin: 1rem auto;
    display: block;
    text-align: center;
  }

  .contact-form {
    width: 100%;
  }

  #about4 h3 {
    text-align: left;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 1rem auto;
    width: 90%;
  }

  /* nav is fixed, no header wrapper needed */

  main {
    padding-left: 12.5%;
    padding-right: 12.5%;
  }

  .hide-on-mobile {
    display: none;
  }

  .show-on-mobile {
    display: block;
  }
}

/* =====================
   FORM LABELS
===================== */

label {
  color: #f5f5f5;
  -webkit-text-fill-color: #f5f5f5;
  font-family: 'Playfair Display', serif;
}

/* =====================
   ULTIMATE MEMBER BUTTON
===================== */

.um-button {
  background-color: rgb(104, 2, 2) !important;
  border-color: rgb(104, 2, 2) !important;
  color: #f5f5f5 !important;
}

.um-button:hover {
  background-color: crimson !important;
  border-color: crimson !important;
}

/* =====================
   HIDE ULTIMATE MEMBER REGISTER BUTTON
===================== */

.um-button.um-alt {
  display: none !important;
}
