/*
Theme Name: Svartinge Vägförening 2026
Theme URI:
Author: Wolfbit AB
Author URI:
Description: Tema för övre Svärtinge Vägförening..
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: svartinge-vagforening
Tags: custom-colors, custom-logo, full-site-editing
*/

/* ==========================================================================
   Svartinge Vägförening — Custom Theme CSS
   ========================================================================== */

/* --- Centered page frame (matches sample look) --------------------------- */
body {
  background: #f3f5f2;
}

body .osvf-page-frame {
  max-width: 1400px;
  margin: 20px auto 32px;
  background: #ffffff;
  border: 1px solid #dfe9db;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(26, 61, 26, 0.08);
  min-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
}

body.osvf-width-1200 .osvf-page-frame {
  max-width: 1200px;
}

body.osvf-width-1400 .osvf-page-frame {
  max-width: 1400px;
}

body.osvf-width-full .osvf-page-frame {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  border-left: none;
  border-right: none;
  border-radius: 0;
}

/* Readability baseline */
body .osvf-page-frame,
body .osvf-page-frame p,
body .osvf-page-frame li {
  font-size: 1rem;
  line-height: 1.55;
}

/* Remove Gutenberg constrained max-width/margins on homepage sections */
body.home .osvf-home-main > section {
  margin-block-start: 0 !important;
  margin-top: 0 !important;
  max-width: none !important;
}

body.home .osvf-home-main > section.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

@media (max-width: 1280px) {
  body .osvf-page-frame {
    margin-left: 16px;
    margin-right: 16px;
  }
}

@media (max-width: 782px) {
  body .osvf-page-frame {
    margin-top: 10px;
    margin-left: 0;
    margin-right: 0;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}

body .osvf-page-frame > .wp-block-group,
body .osvf-page-frame > .wp-block-template-part,
body .osvf-page-frame > main {
  margin-block-start: 0 !important;
}

body .osvf-page-frame > main {
  flex: 1 1 auto;
}

/* --- Sticky header + admin bar offset ------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e0ecd9;
  box-shadow: 0 1px 4px rgba(26,61,26,0.06);
}

body .osvf-page-frame .site-header {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

@media (max-width: 900px) {
  body .osvf-page-frame .site-header {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

body .site-header .logo-area {
  gap: 14px !important;
}

body .site-header .logo-box {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

body .site-header .logo-box .custom-logo {
  width: 120px;
  max-width: none;
  height: auto;
}

body .site-header .site-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a3d1a;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

body .site-header .primary-nav {
  gap: 18px !important;
}

body .site-header .primary-nav .wp-block-navigation-item__content {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4A7043;
  text-decoration: none;
  padding-bottom: 2px;
}

body .site-header .primary-nav .current-menu-item .wp-block-navigation-item__content,
body .site-header .primary-nav .current_page_item .wp-block-navigation-item__content {
  color: #1a3d1a;
  font-weight: 700;
  border-bottom: 2px solid #4A7043;
}

/* Header nav: give links room; avoid wrapped labels on mid widths */
body .site-header .primary-nav.wp-block-navigation {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

body .site-header .primary-nav .wp-block-navigation__container {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

body .site-header .primary-nav .wp-block-navigation-item__content {
  white-space: nowrap;
}

/* Small tablet: hamburger only up to 1023px (from 1024px horizontal + tighter type) */
@media (min-width: 600px) and (max-width: 1023px) {
  body .site-header .primary-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open):not(.hidden-by-default) {
    display: none !important;
  }

  body .site-header .primary-nav.wp-block-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex !important;
  }
}

/* 1024px–1439px: horizontal nav with tighter spacing so e.g. 1100px fits all links */
@media (min-width: 1024px) and (max-width: 1439px) {
  body .site-header .primary-nav .wp-block-navigation__container {
    gap: 0.5rem !important;
  }

  body .site-header .primary-nav .wp-block-navigation-item__content {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  body .site-header .primary-nav .wp-block-navigation__container {
    gap: 0.4rem !important;
  }

  body .site-header .primary-nav .wp-block-navigation-item__content {
    font-size: 0.6875rem;
    letter-spacing: 0.015em;
  }

  body .site-header .logo-box .custom-logo {
    width: 88px;
  }

  body .site-header .site-name {
    font-size: 0.9rem;
  }
}

@media (min-width: 1440px) {
  body .site-header .primary-nav .wp-block-navigation__container {
    gap: 1rem !important;
  }
}

/* Meeting strip directly under header */
.osvf-motesrad {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 0 0;
  padding: 6px 24px;
  min-height: 32px;
  background: #f0f7ee;
  border-bottom: 1px solid #d4e8cf;
  color: #2f4f2b;
  font-size: 0.875rem;
}

.osvf-motesrad p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.3;
}

@media (max-width: 980px) {
  body .site-header .logo-box .custom-logo {
    width: 96px;
  }
  body .site-header .site-name {
    font-size: 0.95rem;
  }
}

@media (max-width: 900px) {
  .osvf-motesrad {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 42px;
    padding: 8px 16px;
  }
}

/* Hide "Påminnelser" from top menu (moved to dedicated homepage section) */
body.home .site-header .primary-nav a[href*="paminnelser"] {
  display: none !important;
}

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* --- Hero section -------------------------------------------------------- */
.hero-section .wp-block-columns {
  gap: 0 !important;
  min-height: 45vh;
  align-items: stretch;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.hero-section .hero-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: clamp(34px, 5vw, 70px) clamp(26px, 4.5vw, 64px);
}

.hero-section .hero-text-col > * {
  max-width: 33rem;
}

.hero-section .hero-text-col h1 {
  font-size: clamp(1.9rem, 3vw, 2.6rem) !important;
  line-height: 1.2 !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.75rem !important;
}

.hero-section .hero-text-col p {
  max-width: 29rem;
  font-size: 1rem;
  line-height: 1.55;
}

.hero-section .hero-photo-col {
  padding: 0 !important;
  overflow: hidden;
  /* background-image injected via wp_head in functions.php */
  background-size: cover;
  background-position: center;
}

.hero-eyebrow {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  color: var(--wp--preset--color--forest-mid) !important;
  margin-bottom: 0.75rem !important;
}

@media (max-width: 781px) {
  .hero-section .wp-block-columns {
    flex-direction: column-reverse;
  }
  .hero-section .hero-photo-col {
    min-height: 240px;
  }
}

/* --- Section badge ------------------------------------------------------- */
body .osvf-page-frame p.section-badge,
body .osvf-page-frame .section-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wp--preset--color--forest-mid) !important;
  background: #e8f5e4 !important;
  border-radius: 20px;
  padding: 3px 10px !important;
  margin-bottom: 10px !important;
  line-height: 1.1 !important;
  width: fit-content;
  max-width: 100%;
}

/* Keep table headers aligned with table body content */
.osvf-page-frame .wp-block-table table th {
  text-align: left;
}

/* --- Felanmalan map picker ----------------------------------------------- */
.osvf-map-picker {
  border: 1px solid #d4e8cf;
  border-radius: 10px;
  background: #f8fbf7;
  padding: 12px;
  margin: 16px 0;
}

.osvf-map-canvas {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #dfe9db;
}

.osvf-map-coordinates {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-top: 10px;
  align-items: end;
}

.osvf-map-coordinates label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8125rem;
  color: #355532;
}

.osvf-map-coordinates input {
  width: 100%;
  border: 1px solid #c8dcc3;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font-size: 0.95rem;
  color: #1a3d1a;
}

.osvf-map-copy {
  border: none;
  border-radius: 6px;
  background: #4a7043;
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
}

.osvf-map-copy:hover {
  background: #1a3d1a;
}

.osvf-map-help {
  margin: 8px 0 0 !important;
  color: #4a6e45;
  font-size: 0.9rem;
}

@media (max-width: 781px) {
  .osvf-map-coordinates {
    grid-template-columns: 1fr;
  }
}

/* --- Section sizing/borders as in sample --------------------------------- */
body.home .osvf-home-main > section:not(.hero-section) {
  padding: 24px 28px !important;
  border-top: 1px solid #e0ecd9;
}

/* Remove Gutenberg default vertical flow gaps between sections */
body.home .osvf-home-main > section,
body.home .osvf-home-main > * {
  margin-block-start: 0 !important;
  margin-top: 0 !important;
}

body.home .osvf-home-main > section.email-section {
  border-top: 1px solid #e0ecd9;
}

@media (max-width: 781px) {
  body.home .osvf-home-main > section:not(.hero-section) {
    padding: 20px 18px !important;
  }
}

/* Inner pages: keep readable edge padding on small screens */
@media (max-width: 900px) {
  .osvf-page-frame main > section,
  .osvf-page-frame main > article {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

.avgift h2,
.email-section h2,
.meetings h2,
.reminders-section h2,
.news h2 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #1a3d1a;
  margin: 0 0 14px !important;
}

.email-section > p {
  font-size: 1rem;
  color: #4a6e45;
  line-height: 1.5;
  margin: 0 0 12px;
}

/* --- Vagavgift grid ------------------------------------------------------ */
.vagavgift-grid .wp-block-group {
  border-top: 2px solid var(--wp--preset--color--forest-light);
  background: var(--wp--preset--color--surface);
  border-radius: 6px;
  padding: 16px 12px;
  text-align: center;
}

.vagavgift-grid .wp-block-group.cta-card {
  border-top-color: var(--wp--preset--color--forest-mid);
  background: var(--wp--preset--color--forest-mid);
  color: #ffffff;
}

.vagavgift-grid .wp-block-group.cta-card p {
  color: #ffffff;
}

/* Emoji icon above label in each card */
.vagavgift-emoji {
  font-size: 2rem !important;
  line-height: 1 !important;
  margin: 0 0 0.5rem !important;
}

.vagavgift-label {
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: var(--wp--preset--color--forest-dark) !important;
  margin: 0 !important;
  line-height: 1.35 !important;
}

.vagavgift-item.cta-card .vagavgift-label {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* --- Email / info box ---------------------------------------------------- */
body.home .osvf-home-main > section.email-faktura-section {
  background: var(--wp--preset--color--white, #ffffff);
}

.info-box {
  border-left: 3px solid var(--wp--preset--color--forest-mid);
  background: #ffffff;
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
}

/* --- Meeting cards ------------------------------------------------------- */
.meeting-card {
  border-left: 3px solid var(--wp--preset--color--forest-mid);
  background: var(--wp--preset--color--surface);
  border-radius: 8px;
  padding: 14px;
}

.meeting-card .label,
.meeting-card .meeting-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4A7043;
  margin-bottom: 4px;
}

.meeting-card .date,
.meeting-card .meeting-date {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a3d1a;
  margin: 0;
}

.meeting-card .time,
.meeting-card .meeting-time {
  font-size: 0.9375rem;
  color: #64748b;
  margin-top: 2px;
  margin-bottom: 0;
}

.reminders-section p {
  font-size: 1rem;
  color: #4a6e45;
  line-height: 1.5;
  margin: 0 0 12px;
}

.contact-extra-section p {
  font-size: 1rem;
  color: #3f5e3a;
  margin: 0 0 12px;
}

/* --- Moten shortcode output ---------------------------------------------- */
.osvf-moten {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.news-item {
  background: #ffffff;
  border-radius: 6px;
  padding: 12px 14px !important;
  margin-bottom: 8px;
  border-left: 3px solid #A8D5A1 !important;
}

.news-item .news-date,
.news-item .wp-block-post-date {
  font-size: 0.8125rem !important;
  color: #4A7043 !important;
  font-weight: 600;
  margin-bottom: 3px;
}

.news-item .news-title,
.news-item .wp-block-post-title {
  font-size: 1.125rem !important;
  font-weight: 700;
  color: #1a3d1a !important;
  margin-bottom: 3px !important;
}

.news-item .news-body,
.news-item .wp-block-post-excerpt__excerpt {
  font-size: 1rem;
  color: #64748b;
  line-height: 1.4;
}


@media (max-width: 600px) {
  .osvf-moten { grid-template-columns: 1fr; }
}

/* --- Protokoll list ------------------------------------------------------ */
.osvf-protokoll-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.osvf-protokoll-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e0ecd9;
  gap: 16px;
}

.osvf-protokoll-list li:hover {
  background: var(--wp--preset--color--surface);
}

.osvf-protokoll-year {
  font-weight: 700;
  color: var(--wp--preset--color--forest-mid);
  min-width: 50px;
}

.osvf-protokoll-title {
  flex: 1;
}

.osvf-protokoll-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wp--preset--color--forest-mid);
  color: #ffffff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none !important;
}

.osvf-protokoll-download:hover {
  background: var(--wp--preset--color--forest-dark);
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  padding: 48px 0 0;
}

@media (max-width: 781px) {
  .site-footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

.site-footer h4 {
  color: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.site-footer p,
.site-footer a {
  color: var(--wp--preset--color--forest-light);
  font-size: 0.875rem;
  line-height: 1.8;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(168,213,161,0.2);
  margin-top: 32px;
  padding: 16px 0;
  font-size: 0.8125rem;
  text-align: center;
}

/* --- Page title banner --------------------------------------------------- */
.page-title-banner {
  background: var(--wp--preset--color--surface);
  border-bottom: 1px solid #e0ecd9;
  padding: clamp(32px, 4vw, 56px) 0;
}

/* --- Information page: anchor TOC + scroll offset (sticky header) -------- */
.osvf-information-toc-wrap {
  margin-bottom: 8px;
}

.osvf-information-toc {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #dfe9db;
  border-radius: 10px;
  background: #f8fbf7;
}

.osvf-information-toc__label {
  margin: 0 0 10px !important;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--wp--preset--color--forest-mid);
}

.osvf-information-toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.osvf-information-toc__list a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wp--preset--color--forest-dark);
  text-decoration: underline;
  text-decoration-color: rgba(74, 112, 67, 0.35);
  text-underline-offset: 3px;
}

.osvf-information-toc__list a:hover {
  color: var(--wp--preset--color--forest-mid);
  text-decoration-color: var(--wp--preset--color--forest-mid);
}

body .osvf-page-frame main section[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 782px) {
  body.admin-bar .osvf-page-frame main section[id] {
    scroll-margin-top: 120px;
  }
}

/* --- CF7 form styling ---------------------------------------------------- */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: #ffffff;
  transition: border-color 0.15s;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--forest-mid);
  box-shadow: 0 0 0 3px rgba(74,112,67,0.12);
}

.wpcf7 input[type="submit"] {
  background: var(--wp--preset--color--forest-mid);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.wpcf7 input[type="submit"]:hover {
  background: var(--wp--preset--color--forest-dark);
}
