/* ==========================================================================
   Freifunk Fulda – Clean, Readable & Accessible CI Stylesheet
   CI Colors: Magenta (#dc0067), Yellow (#ffb400), Cyan (#009ee0), Dark (#2c2c2c)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Accessibility & Email Obfuscation
   -------------------------------------------------------------------------- */
*:focus-visible {
  outline: 2px solid #dc0067 !important;
  outline-offset: 2px !important;
}

.main-navigation a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid #ffb400 !important;
  outline-offset: -2px !important;
}

.skip-link.screen-reader-text:focus {
  background-color: #2c2c2c;
  color: #ffffff;
  border: 2px solid #ffb400;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  top: 10px;
  left: 10px;
  z-index: 100001;
}

.fff-mail-rtl {
  unicode-bidi: bidi-override;
  direction: rtl;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   2. Header & Navigation (Clear Separation, Original Geometry)
   -------------------------------------------------------------------------- */
.fff-header-wrap {
  background: #ffffff;
}

/* Show only the top 180px white Fulda map portion of header-bg.jpg */
.fff-header-top {
  background-color: #ffffff;
  background-position: left top;
  background-repeat: repeat-x;
  height: 180px;
  overflow: hidden;
  position: relative;
}

.fff-header-top #wrap-header {
  background: transparent;
  height: 180px;
  position: relative;
}

.fff-header-top .site-branding {
  text-align: left;
  padding: 30px 0 0 40px;
  height: 180px;
  position: relative;
}

.fff-header-top #logo img {
  display: block;
  height: 150px;
  width: auto;
  max-height: 150px;
}

.fff-header-top .title-group {
  text-align: center;
  position: absolute;
  top: 92px;
  left: 55%;
  transform: translate(-50%, -50%);
  z-index: 9;
}

.fff-header-top .site-title {
  font-size: 48px;
  font-weight: bold;
  line-height: 52px;
  background-color: rgba(255, 255, 255, 0.82);
  padding: 2px 12px;
  margin: 0;
  display: inline-block;
}

.fff-header-top .site-description {
  font-size: 15px;
  font-weight: 600;
  color: #333333;
  background-color: rgba(255, 255, 255, 0.82);
  padding: 4px 12px;
  margin-top: 4px;
}

/* Full-width Navigation Bar clearly separated from white header */
.fff-nav-bar {
  background-color: #dc0067;
  width: 100%;
}

.fff-nav-bar > .wrap {
  background: transparent;
}

#site-navigation.main-navigation {
  background: #dc0067;
  float: none;
  padding: 0 20px;
}

#site-navigation.main-navigation::after {
  content: "";
  display: table;
  clear: both;
}

@media (min-width: 960px) {
  .main-navigation li a {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 22px 26px;
    line-height: 1.2;
    text-transform: uppercase;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .main-navigation li a:hover,
  .main-navigation li a:focus {
    background-color: #009ee0 !important;
    color: #ffffff !important;
  }

  /* Active menu item: high-contrast dark text on light gray, matching original CI */
  .nav-menu .current_page_item > a,
  .nav-menu .current-post-ancestor > a,
  .nav-menu .current-menu-item > a {
    background-color: #e8e8e8 !important;
    color: #2c2c2c !important;
    font-weight: 700;
  }

  .nav-menu .current_page_item > a:hover,
  .nav-menu .current-menu-item > a:hover {
    background-color: #009ee0 !important;
    color: #ffffff !important;
  }
}

@media (max-width: 959px) {
  .fff-header-top {
    height: auto;
    min-height: 150px;
    background-image: none !important;
    background-color: #ffffff;
    padding: 16px 20px;
  }

  .fff-header-top #wrap-header,
  .fff-header-top .site-branding {
    height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .fff-header-top #logo {
    float: none;
    width: auto;
  }

  .fff-header-top #logo img {
    height: 110px;
  }

  .fff-header-top .title-group {
    position: static;
    transform: none;
    padding: 0;
  }

  .menu-toggle {
    padding: 14px 22px;
    font-size: 13px;
    font-weight: 700;
  }

  ul.nav-menu li a {
    color: #ffffff !important;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .nav-menu .current_page_item > a,
  .nav-menu .current-menu-item > a {
    background-color: #b80056 !important;
    color: #ffb400 !important;
  }
}

/* --------------------------------------------------------------------------
   3. Page Container, Float Clearing & Spacing Fixes
   -------------------------------------------------------------------------- */
body.custom-background {
  background-color: #eeeeee;
  color: #2c2c2c;
}

#wrap-content.wrap {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Ensure consistent padding and bottom breathing room on all pages & homepage */
#content.site-content,
body.home.page #content.site-content {
  padding: 36px 40px 56px 40px !important;
  margin: 0 !important;
}

body.home.page #primary.site-content {
  padding: 0 !important;
  margin: 0 !important;
  float: none;
  width: 100%;
}

body.home.page .entry-content {
  padding: 0 !important;
}

#content.site-content::after,
#primary::after,
main.site-main::after,
.entry-content::after,
.tabcontent::after,
.responsive-tabs__panel::after {
  content: "";
  display: table;
  clear: both;
}

/* --------------------------------------------------------------------------
   4. Typography & Inclusive Link Readability
   -------------------------------------------------------------------------- */
.entry-content {
  color: #2c2c2c;
  font-size: 16px;
  line-height: 1.7;
}

.entry-content p {
  margin-bottom: 1.4em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.5em 2.2em;
}

.entry-content li {
  margin-bottom: 0.4em;
}

/* Readable link contrast (WCAG AA compliant) with subtle underline in text */
.site-content .entry-content a:not(.accordion-toggle):not(.page-numbers) {
  color: #0077b3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-content .entry-content a:not(.accordion-toggle):not(.page-numbers):hover {
  color: #dc0067;
}

h1.page-title,
#home-content h1 {
  color: #dc0067 !important;
  font-family: 'league_gothic', "Open Sans", sans-serif;
  font-size: 38px;
  line-height: 1.15;
  margin: 0 0 28px 0;
}

.entry-content h2:not(.tabtitle) {
  font-size: 24px;
  line-height: 1.3;
  margin: 1.5em 0 0.7em 0;
  color: #2c2c2c;
}

.entry-content h3 {
  font-size: 20px;
  line-height: 1.35;
  margin: 1.3em 0 0.6em 0;
  color: #2c2c2c;
}

.entry-content h4 {
  font-size: 17px;
  line-height: 1.4;
  margin: 1.2em 0 0.5em 0;
  color: #2c2c2c;
}

/* --------------------------------------------------------------------------
   5. Homepage Icon Boxes & Recent Posts Section
   -------------------------------------------------------------------------- */
#home-content .entry-content {
  padding-top: 8px !important;
}

/* Clean 4-column grid without Bootstrap float/pseudo-element collisions */
#home-content .row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin: 28px 0 36px 0 !important;
}

#home-content .row::before,
#home-content .row::after {
  display: none !important;
}

#home-content .col-sm-3 {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 900px) {
  #home-content .row {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 540px) {
  #home-content .row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.ico-box {
  text-align: center;
  padding: 12px 10px;
}

.ico-box .fa {
  background: #ffb400;
  color: #2c2c2c;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  text-align: center;
  line-height: 96px;
  font-size: 40px;
  margin-bottom: 14px;
}

.ico-box .box-title {
  font-size: 15px !important;
  color: #2c2c2c;
  font-weight: 700;
  margin: 0 0 8px 0 !important;
  text-transform: uppercase;
}

.ico-box p:not(.box-title) {
  font-size: 15.5px !important;
  line-height: 1.6 !important;
  color: #444444;
  margin: 0 !important;
}

/* Homepage Recent Posts ("Aktuelle Beiträge") with proper spacing */
#home-page-section {
  margin-top: 36px;
  padding-top: 28px;
  padding-bottom: 8px;
  border-top: 1px solid #e0e0e0;
}

#home-page-section .grid1 .col {
  float: none;
  width: 100%;
  margin: 0;
}

#home-page-section .widget-title {
  font-size: 16px;
  color: #2c2c2c;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fff-recent-posts-list {
  list-style: disc;
  margin: 0 0 0 1.4em !important;
}

.fff-recent-posts-list li {
  margin-bottom: 10px;
  font-size: 16px;
}

.fff-recent-posts-list .fff-post-date {
  color: #666666;
  font-size: 14px;
  margin-left: 8px;
}

/* --------------------------------------------------------------------------
   6. Blog Archive Grid (`.grid2`) & Post Meta
   -------------------------------------------------------------------------- */
main.site-main > .grid2.clearfix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

main.site-main > .grid2.clearfix::before,
main.site-main > .grid2.clearfix::after {
  display: none !important;
}

main.site-main > .grid2.clearfix > article.col {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

@media (max-width: 740px) {
  main.site-main > .grid2.clearfix {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.site-content .entry-meta,
.site-content .entry-meta a {
  color: #666666 !important;
  font-size: 13px;
}

.site-content .entry-meta a:hover {
  color: #dc0067 !important;
}

.no-thumbnail h1.entry-title,
.grid2 article h1.entry-title {
  font-family: 'league_gothic', "Open Sans", sans-serif;
  font-size: 32px;
  line-height: 1.15;
  margin: 6px 0 12px 0;
}

.grid2 article h1.entry-title a {
  text-decoration: none !important;
  color: #2c2c2c !important;
}

.grid2 article h1.entry-title a:hover {
  color: #dc0067 !important;
}

/* --------------------------------------------------------------------------
   7. Content Elements: Tables, Tabs, FAQ, Figures & Sidebar
   -------------------------------------------------------------------------- */
.site-content .entry-content table {
  width: 100% !important;
  height: auto !important;
  border-collapse: collapse;
  margin: 20px 0 28px 0;
}

.site-content .entry-content th {
  background: #f5f5f5;
  color: #2c2c2c;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #dc0067;
}

.site-content .entry-content td {
  padding: 10px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

/* Responsive Tabs (Mitmachen) – prevent floated images from overflowing */
.responsive-tabs .responsive-tabs__panel {
  padding: 24px !important;
  margin-bottom: 24px !important;
  overflow: hidden;
}

.responsive-tabs img.alignleft {
  margin: 4px 20px 16px 0;
}

.responsive-tabs img.alignright {
  margin: 4px 0 16px 20px;
}

/* FAQ Accordion */
.panel-group {
  margin-bottom: 28px !important;
}

.panel-group .panel {
  border: 1px solid #dddddd;
  border-radius: 4px;
  margin-bottom: 8px !important;
}

.panel-default > .panel-heading {
  background-color: #f7f7f7;
  padding: 0;
}

.panel-title > a.accordion-toggle {
  display: block;
  padding: 12px 16px;
  color: #2c2c2c !important;
  font-weight: 600;
  text-decoration: none !important;
}

.panel-title > a.accordion-toggle:hover {
  color: #dc0067 !important;
  background-color: #f0f0f0;
}

.panel-body {
  padding: 16px;
  line-height: 1.65;
}

/* Captioned Figures */
figure.wp-caption {
  margin-bottom: 24px !important;
  max-width: 100%;
}

.wp-caption-text {
  color: #595959 !important;
  font-size: 13px;
  margin-top: 8px;
}

/* Sidebar Widgets */
#secondary .widget {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8e8e8;
}

#secondary .widget:last-child {
  border-bottom: none;
}

#secondary .widget-title {
  font-size: 14px;
  color: #2c2c2c;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
}

#secondary .widget a {
  color: #0077b3;
}

#secondary .widget a:hover {
  color: #dc0067;
}

/* --------------------------------------------------------------------------
   8. Magrathea Laboratories e.V. Events Calendar (`#events`)
   -------------------------------------------------------------------------- */
#events {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

#events .event {
  display: flex;
  flex-direction: row;
  background-color: #f7f7f7;
  border: 1px solid #e0e0e0;
  color: #2c2c2c;
  border-radius: 4px;
  overflow: hidden;
  text-align: left;
}

@media (max-width: 768px) {
  #events .event {
    flex-direction: column;
  }
}

#events .event .datetime {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  color: #ffffff;
  background-color: #2c2c2c;
  border-right: 4px solid #dc0067;
  padding: 1rem;
  width: 11rem;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #events .event .datetime {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    border-right: none;
    border-bottom: 4px solid #dc0067;
    gap: 0.5rem;
  }
}

#events .event .datetime .wday {
  font-weight: 700;
  color: #ffb400;
}

#events .event .datetime .date,
#events .event .datetime .time {
  font-size: 0.85em;
  color: #e8e8e8;
}

@media (max-width: 768px) {
  #events .event .datetime .wday,
  #events .event .datetime .time {
    flex-grow: 0;
  }
  #events .event .datetime .date {
    flex-grow: 1;
    text-align: center;
  }
}

#events .event .description {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  flex-grow: 1;
}

#events .event .description .summary {
  font-weight: 700;
  font-size: 1.1em;
  color: #dc0067;
  margin-bottom: 0.25rem;
}

#events .event .description .details {
  margin: 0;
  padding: 0.4rem 0;
  white-space: pre-line;
}

#events .event .description .location {
  font-style: italic;
  font-size: 0.85em;
  color: #595959;
  margin-top: auto;
  padding-top: 0.4rem;
}

/* --------------------------------------------------------------------------
   9. Footer (`#colophon`)
   -------------------------------------------------------------------------- */
.out-wrap.site-footer {
  background: #2c2c2c;
}

#colophon.site-footer {
  padding: 32px 40px 24px 40px;
}

.site-footer p {
  color: #cccccc;
  font-size: 14px;
  line-height: 1.6;
}

.site-footer a {
  color: #29b6f6 !important;
}

.site-footer a:hover {
  color: #ffb400 !important;
}

@media (max-width: 650px) {
  #content.site-content,
  body.home.page #content.site-content {
    padding: 24px 20px 40px 20px !important;
  }

  #colophon.site-footer {
    padding: 24px 20px;
  }
}
