/*
    Theme Name:   Twenty Twenty-Five Child
    Template:     twentytwentyfive
*/

/* ------------------ Layout & Spacing ------------------ */

header .wp-block-group.alignfull {
  padding: 0 !important;
  margin: 0 !important;
}

body .wp-block-group.has-global-padding {
  padding: 0 !important;
  margin: 0 !important;
}

footer .wp-block-group.has-global-padding {
  padding-top: 25px !important;
  padding-bottom: 25px !important;
  margin: 0 !important;
}

p, .wp-video {
  margin-top: 20px !important;
}

h1,
h2,
h3 {
  text-decoration-line: underline !important;
  text-decoration-color: var(--tz-heading-underline-color, currentColor) !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 2px !important;
  color: var(--tz-heading-underline-color) !important;
  margin-top: 30px !important;
}

h1 a,
h2 a,
h3 a {
  color: inherit !important; /* forces link to use heading color */
  text-decoration: inherit !important; /* remove double underline */
}

/* Hover effect for links inside headings */
h1 a:hover,
h2 a:hover,
h3 a:hover {
  color: var(--tz-course-page-link-hover-color) !important; /* accent hover color */
  text-decoration-color: var(--tz-course-page-link-hover-color) !important; /* underline changes too */
}

hr {
  border: none !important;
  height: 3px !important;

  background-image: linear-gradient(
    to right,
    transparent,
    var(--tz-hr-color) 20%,
    var(--tz-hr-color) 80%,
    transparent
  ) !important;

  margin-top: 20px !important;
  margin-bottom: 20px !important;
}


header figure.wp-block-image {
  margin-bottom: 10px !important;
  padding: 0;
}

footer.wp-block-template-part .wp-block-column.footer-html p {
  margin: 0 !important;
}

strong {
    font-weight: bold !important;
}

/* ------------------ Video ------------------ */
.wp-video {
  max-width: var(--wp--style--global--content-size) !important;
  width: 100% !important;
  margin: 0 auto;
}

.wp-video video {
  width: 100% !important;
  height: auto !important;
}

.tz-video-wrapper {
  margin: 50px 0; /* top & bottom spacing */
}

/* ------------------ Gallery ------------------ */
.tanzzentrum-extra .tz-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  justify-content: start;
  gap: 15px;
  margin: 50px 0;
}

.tanzzentrum-extra .tz-gallery-item.image-frame {
  position: relative;
  border-radius: 8px;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
}

.tanzzentrum-extra .tz-gallery-item.image-frame:hover {
  transform: scale(1.05);
  box-shadow: 4px 4px 10px rgba(0,0,0,0.25);
}

.tanzzentrum-extra .tz-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

/* ------------------ Gallery Responsive & List Layout ------------------ */

/* Medium screens: 2 columns, max 45% each */
@media (max-width: 1024px) and (min-width: 769px) {
  .tanzzentrum-extra .tz-gallery-grid {
    grid-template-columns: repeat(2, minmax(150px, 43%));
    justify-content: start;
  }
}

/* Mobile override: max 1 image per row */
@media (max-width: 768px) {
  .tanzzentrum-extra .tz-gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.tz-gallery-clear {
  clear: both;
}

/* Base layout for list view */
.tz-galerie-list, .tz-nachrichten-list, .tz-allgemein-list, .tz-team-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
  margin: 40px 0;
}

.tz-galerie-item, .tz-nachricht-item, .tz-allgemein-item, .tz-team-item {
  flex: 0 0 100%;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 40px;
}

.tz-galerie-image, .tz-nachricht-image, .tz-allgemein-image, .tz-team-image {
  flex: 0 0 auto;
  width: 300px;
  height: auto;
}

.tz-galerie-image img, .tz-nachricht-image img, .tz-allgemein-image img, .tz-team-image img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

.tz-galerie-image img:hover, .tz-nachricht-image img:hover, .tz-allgemein-image img:hover, .tz-team-image img:hover {
  transform: scale(1.05);
  box-shadow: 4px 4px 10px rgba(0,0,0,0.25);
}

.tz-galerie-text, .tz-nachricht-text, .tz-allgemein-text, .tz-team-text {
  flex: 1;
  text-align: left;
}

/* ------------------ Gallery Responsive: Tablets & Mobile ------------------ */
@media (max-width: 900px) {
  .tz-galerie-item, .tz-nachricht-item, .tz-allgemein-item, .tz-team-item {
    flex-direction: column;
    align-items: center;
  }

  .tz-galerie-image, .tz-nachricht-image, .tz-allgemein-image, .tz-team-image {
    width: 100%;
    max-width: 600px;
  }

  .tz-galerie-image img, .tz-nachricht-image img, .tz-allgemein-image img, .tz-team-image img {
    width: 100%;
    max-width: 100%;
  }

  .tz-galerie-text, .tz-nachricht-text, .tz-allgemein-text, .tz-team-text {
    width: 100%;
    text-align: left;
    margin-top: 15px;
    padding: 0 10px;
  }

  .tz-list-empty {
    display: none;
  }
}

/* Placeholder when no image is present */
.tz-list-empty {
  flex: 0 0 300px;
  align-self: stretch;
  background: transparent;
}

.tz-list-empty::before {
  content: "";
  display: block;
  width: 100%;
}

.tz-list-empty:hover {
  transform: none;
  box-shadow: none;
}

/* ------------------ Top Menu Layout ------------------ */
nav.wp-block-navigation.header-menu {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 10px;
}

nav.wp-block-navigation.header-menu .wp-block-navigation__container > .wp-block-navigation-item > a {
  font-weight: 700; /* bold */
  text-decoration: none;
  padding: 0.75rem 1rem;
  transition: color 0.25s ease, background-color 0.25s ease;
}

nav.wp-block-navigation.header-menu .wp-block-navigation__container > .wp-block-navigation-item > a:hover {
  /* color handled by style-colors.css */
}

nav.wp-block-navigation.header-menu .wp-block-navigation__submenu-container {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  min-width: 180px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 0.25rem 0;
  z-index: 999;
}

nav.wp-block-navigation.header-menu .wp-block-navigation-item.has-child:hover > .wp-block-navigation__submenu-container {
  display: block;
}

/* ------------------ Submenu & Menu Layout ------------------ */
nav.wp-block-navigation.header-menu a {
  font-size: 1rem;
  line-height: 1.5;
}

nav.wp-block-navigation.header-menu .wp-block-navigation__submenu-container a {
  font-weight: 500; /* normal weight */
  padding: 0.6rem 1rem;
  text-decoration: none;
  display: block;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.wp-block-navigation.header-menu {
  display: flex;
  justify-content: center;
}

.wp-block-navigation.header-menu .wp-block-navigation__container > .wp-block-navigation-item > a::after {
  content: "";
  display: block;
  height: 2px;
  width: 0%;
  /* transition can remain here */
}

.wp-block-navigation.header-menu .wp-block-navigation__container > .wp-block-navigation-item > a:hover::after {
  width: 100%;
}

/* ------------------ Footer Menu Layout ------------------ */
nav.wp-block-navigation.footer-menu {
  text-align: center;
  padding: 0;
}

nav.wp-block-navigation.footer-menu a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0.4rem;
}

nav.wp-block-navigation.footer-menu a::after {
  content: "";
  display: block;
  height: 1px;
  width: 0%;
  margin: 0 auto;
  /* transition can remain here */
}

nav.wp-block-navigation.footer-menu a:hover::after {
  width: 100%;
}

@media (max-width: 768px) {
    /* Stack the footer menu items vertically */
    nav.wp-block-navigation.footer-menu .wp-block-navigation__container {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Full-width <li> items with spacing */
    nav.wp-block-navigation.footer-menu .wp-block-navigation-item {
        width: 100%;
        /*margin: 0.2rem 0;*/
        text-align: center;
    }

    /* Center the <a> and fix underline width */
    nav.wp-block-navigation.footer-menu .wp-block-navigation-item__content {
        display: inline-block; /* underline fits text */
        width: auto;
    }

    nav.wp-block-navigation.footer-menu a::after {
        display: block;
        height: 1px;
        width: 0;
        margin: 0 auto;
    }

    nav.wp-block-navigation.footer-menu a:hover::after {
        width: 100%;
    }
@media (max-width: 768px) {
  ul.wp-block-navigation__container.footer-menu {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

}

/* ------------------ TZ Main Menu Layout ------------------ */
.tz-menu {
    list-style: none;
    padding: 0;
    margin: 0 auto 2em auto; /* auto horizontal center + bottom spacing */
    display: flex;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap;
}

.tz-menu-wrapper {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid rgba(0,0,0,0.1); /* border layout, color handled separately */
}

.tz-menu-wrapper ul {
    margin: 0 !important;
    padding: 0 !important;
}

.tz-menu-item a {
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 4px;
    display: block;
    text-align: center;
}

.tz-menu-item a.is-active {
    outline: 2px solid #000;
}

.tz-menu-item a:focus {
    outline: 2px solid #000;
}

.tz-menu-item a:focus-visible {
    outline: 2px dashed #000;
}

/* ------------------ TZ Menu Responsive & Front Page ------------------ */
@media (max-width: 600px) {
    .tz-menu {
        flex-direction: column; /* stack items vertically */
        gap: 0.2em; /* smaller gap when stacked */
        align-items: center;
    }
}

/* Hide page/post title on the front page */
.front-page .wp-block-post-title {
    display: none !important;
}

/* ------------------ TZ Desktop Table Layout ------------------ */
.tz-desktop-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.tz-desktop-table th,
.tz-desktop-table td {
  padding: 12px;
  text-align: left;
}

/* Desktop table column widths */
.tz-desktop-table th:nth-child(1),
.tz-desktop-table td:nth-child(1) { width: 30%; } /* Kurs */
.tz-desktop-table th:nth-child(2),
.tz-desktop-table td:nth-child(2) { width: 7%; }  /* Code */
.tz-desktop-table th:nth-child(3),
.tz-desktop-table td:nth-child(3) { width: 7%; }  /* Tag */
.tz-desktop-table th:nth-child(4),
.tz-desktop-table td:nth-child(4) { width: 20%; } /* Beginn */
.tz-desktop-table th:nth-child(5),
.tz-desktop-table td:nth-child(5) { width: 8%; }  /* Zeit */
.tz-desktop-table th:nth-child(6),
.tz-desktop-table td:nth-child(6) { width: 8%; }  /* Dauer */
.tz-desktop-table th:nth-child(7),
.tz-desktop-table td:nth-child(7) { width: 20%; } /* Gebühr */

/* ------------------ TZ Mobile Cards Layout ------------------ */
.tz-mobile-cards {
  display: none; /* hidden by default, shown only on mobile */
}

@media (max-width: 768px) {
  .tz-desktop-table {
    display: none;
  }

  .tz-mobile-cards {
    display: block;
  }

  .tz-mobile-card {
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
  }

  .tz-mobile-card dl {
    display: grid;
    grid-template-columns: auto 1fr;
    row-gap: 8px;
    column-gap: 10px;
    margin: 0;
  }

  .tz-mobile-card dt {
    font-weight: bold;
  }

  .tz-mobile-card dd {
    margin: 0;
  }
}
/* ============================
   Kurs table / calendar layout
   ============================ */

/* Top meta grid layout */
.tz-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 20px;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* Label inline & clearfix */
.field-label-inline {
    font-weight: 600;
    display: inline-block;
    margin-right: 6px;
}

.clearfix {
    display: flex;
    gap: 6px;
}

/* Calendar layout */
.tz-kalender-month {
    display: inline-block;
    width: 310px;
    margin: 0 20px 30px 0;
}

.tz-kalender-month-header {
    padding: 6px 4px;
    font-weight: 700;
}

.tz-kalender-table {
    width: 100%;
    border-collapse: collapse;
}

.tz-kalender-table th,
.tz-kalender-table td {
    padding: 4px;
    text-align: center;
}

.tz-kalender-table td {
    width: 14.2%;
    height: 40px;
    border: 1px solid transparent;
}

.tz-kalender-day span {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
}

.tz-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

@media (max-width: 500px) {
    .tz-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* Calendar table layout */
.tz-kalender-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
}

.tz-kalender-table th,
.tz-kalender-day,
.tz-empty {
    padding: 6px;
    text-align: center;
    width: 14.28%;
}

.tz-kalender-day span {
    display: block;
    padding: 4px 0;
}

/* Legend container: grid layout */
.tz-kalender-legend {
    display: grid;
    grid-template-columns: repeat(3, auto); /* each table width fits content */
    gap: 1rem; /* space between tables */
    justify-content: start; /* align to the left */
    margin-top: 1.5rem;
}

/* Tables: keep layout fixed for day cell */
.tz-legend-table {
    width: auto;       /* do not stretch to full grid cell */
    table-layout: fixed;
    border-collapse: collapse;
}

/* Day cell: fixed width */
.tz-legend-table .tz-kalender-day {
    width: 3.5rem;      /* keeps the same width as calendar cells */
    text-align: center;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
}

/* Label cell */
.tz-legend-label-cell {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--tz-kal-th-border);
    background: var(--tz-kal-body-bg);
    color: var(--tz-kal-text-color);
    vertical-align: middle;
    white-space: nowrap;
}

/* Legend title styling */
.tz-kalender-legend-title {
    font-weight: bold;       /* make text bold */
}

@media (max-width: 600px) {
    .tz-kalender-legend {
        grid-template-columns: 1fr; /* stack tables */
        gap: 0.5rem;
    }

    /* Make the table shrink to fit its content */
    .tz-legend-table {
        width: max-content;  /* shrink table to fit the content */
        table-layout: auto;  /* allow proper width calculation */
    }

    /* Ensure 'Tag' cell keeps fixed width */
    .tz-legend-table .tz-kalender-day {
        width: 3.5rem;       /* same as desktop */
    }
}


/*******************************************************************
page layout – structure
*******************************************************************/

/* Outer frame */
.tz-site-frame {
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
}

/* Internal header */
.tz-header {
    padding: 2.5rem 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Main/content */
.tz-main {
    padding: 2rem;
    line-height: 1.65;
}

/* Frame footer */
.tz-footer {
    padding: 2rem;
    text-align: center;
}

.tz-main .wp-block {
    max-width: 100%;
}

.tz-site-frame .wp-block-post-content.has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
    margin-left: 0;
    margin-right: 0;
}

/* ============================
   Kurslist / course grid
   ============================ */

/* Remove weird spacing wrapper */
.tz-dancelist-wrapper {
    display: flow-root;
}

.tz-dancelist-wrapper > p {
    margin: 0;
    padding: 0;
}

.tz-dancelist-wrapper br {
    display: none;
}

/* Course count list grid */
.tz-course-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem; /* space between items */
}

.tz-course-item {
    display: block;
    margin-bottom: 0; /* spacing handled by gap */
}

.tz-course-item a {
    display: block;       /* ensures full block clickable */
    white-space: normal;  /* allow wrapping */
    word-break: break-word;
}

/* Responsive / hover */
.tz-course-item a:hover {
    text-decoration: none;
}
/* ============================
   Anmeldung form layout
   ============================ */

/* Form container */
.tz-anmeldung-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    font-family: sans-serif;
}

/* Fieldsets */
.tz-anmeldung-form fieldset {
    padding: 15px;
    margin-bottom: 20px;
}

/* Legend */
.tz-anmeldung-form legend {
    font-weight: bold;
    padding: 0 5px;
}

/* Form row: label + input */
.tz-anmeldung-form .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 15px;
}

/* Label on the left */
.tz-anmeldung-form .form-row label {
    font-weight: bold;
    width: 150px;      /* fixed width for labels */
    margin-right: 15px;
    text-align: right;
}

/* Input/select/textarea */
.tz-anmeldung-form .form-row select,
.tz-anmeldung-form .form-row input[type="text"],
.tz-anmeldung-form .form-row input[type="email"],
.tz-anmeldung-form .form-row textarea {
    flex: 1;            /* fill remaining space */
    padding: 8px;
    border-radius: 3px;
    box-sizing: border-box;
}

/* Optional: placeholder color */
.tz-anmeldung-form .form-row select option[value=""] {
    color: #888;
}

/* ============================
   Anmeldung form - structure
   ============================ */

/* Read-only inputs */
.tz-anmeldung-form input[readonly] {
    cursor: not-allowed;
}

/* Textarea adjustments */
.tz-anmeldung-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* Submit button layout */
.tz-anmeldung-form button[type="submit"] {
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 3px;
    cursor: pointer;
}

/* Extra hidden fields (honeypot) */
.tz-extra-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
}

/* ============================
   Anmeldung form - responsive
   ============================ */
@media (max-width: 800px) {
    .tz-anmeldung-form .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tz-anmeldung-form .form-row label {
        width: 100%;
        margin-bottom: 5px;
        text-align: left;
    }
}

/* ============================
   Week view cards - layout
   ============================ */

/* Wrapper for all cards per day */
.tz-week-cards {
    display: flex;
    flex-direction: column;
    gap: 4px; /* spacing between cards */
    padding: 4px; /* inner padding */
    box-sizing: border-box;
}

/* Single card */
.tz-week-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Inner layout: code / time / title */
.tz-week-card div {
    display: flex;
    width: 100%;
}

/* Code on the left ~20% */
.tz-week-card-code {
    flex: 0 0 20%;
    text-align: left;
}

/* Time in middle ~10% */
.tz-week-card-time {
    flex: 0 0 10%;
    text-align: center;
    font-weight: bold;
}

/* Title fills remaining space ~70% */
.tz-week-card-title {
    flex: 1 1 auto;
    padding: 0 8px;
}

/* ------------------------------------------------------------
   Course Page view - layout only
------------------------------------------------------------ */

.tz-course_page-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Grid: layout only */
.tz-course_page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

/* Top-level item */
.tz-course_page-item {
    padding: 1rem 1.25rem;
    border-radius: 4px;
}

/* Top-level title */
.tz-course_page-title {
    margin-bottom: 0.75rem;
}

/* Placeholder title (no link, no italic) */
.tz-course_page-title.placeholder {
    opacity: 0.6;
    font-style: normal;
}

/* Links: inherit WP defaults */
.tz-course_page-title a,
.tz-course_page-subitem a {
    text-decoration: underline;
}

.tz-course_page-title a:hover,
.tz-course_page-subitem a:hover {
    text-decoration: none;
}

/* Child list */
.tz-course_page-sublist {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.tz-course_page-subitem {
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tz-course_page-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
