/*
Theme Name: PropComm Classic
Theme URI: https://propcomm.com
Author: PropComm
Author URI: https://propcomm.com
Description: A classic WordPress theme for PropComm — property and community focused.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: propcomm-classic
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   Based on Brand Style Guide
   16px Spacing Base Unit
   ============================================= */
:root {
  /* ── Spacing Scale (base 16px) ── */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 56px;
  --sp-11: 64px;
  --sp-12: 72px;
  --sp-13: 80px;
  --sp-14: 96px;
  --sp-15: 112px;

  /* ── Colors (Brand Guide) ── */
  --color-primary-green: #084823;
  --color-secondary-green: #b3cdad;
  --color-bg-beige: #eae1d7;
  --color-cream: #F7F2EA;

  /* Legacy aliases for backwards compatibility */
  --color-primary: #084823;
  --color-primary-dark: #063620;
  --color-accent: #b3cdad;
  --color-accent-dark: #9fbf99;

  /* Color tints (20% increments) */
  --color-green-80: rgba(8, 72, 35, 0.8);
  --color-green-60: rgba(8, 72, 35, 0.6);
  --color-green-40: rgba(8, 72, 35, 0.4);
  --color-green-20: rgba(8, 72, 35, 0.2);

  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-border: #e5e7eb;

  /* ── Typography ── */
  --font-primary: 'ConcretteXL', Georgia, serif;
  --font-secondary: 'SeasonSans', system-ui, sans-serif;
  --font-title: 'ConcretteXL', Georgia, serif;
  --font-body: 'SeasonSans', system-ui, sans-serif;
  --font-sans: 'SeasonSans', system-ui, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  /* ── Line Heights ── */
  --lh-tight: 1.1;
  --lh-normal: 1.5;
  --lh-relaxed: 1.75;

  /* Size tokens for compatibility */
  --size-xs: 0.75rem;
  --size-sm: 0.875rem;
  --size-base: 1rem;
  --size-lg: 1.125rem;
  --size-xl: 1.25rem;
  --size-2xl: 1.5rem;
  --size-3xl: 1.875rem;
  --size-4xl: 2.25rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);

  --container-max: 1200px;
  --container-pad: clamp(var(--sp-4), 4vw, var(--sp-8));

  --transition: 0.2s ease;
}

/* =============================================
   RESET & BASE
   ============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  background: var(--color-bg);
}

/* Lenis smooth scroll — window scroll mode (no overflow clipping,
   so position: sticky works against the viewport) */
html {
  scroll-behavior: auto !important;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
    color: inherit;
  text-decoration: underline;
  transition: color var(--transition);
}
a:hover {
      color: inherit;
}

ul,
ol {
  padding-left: 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--color-primary-green);
  margin: 0 0 var(--sp-4) 0;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-6);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-6);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 500;
  margin-bottom: var(--sp-5);
}

h4 {
  font-size: var(--size-xl);
  font-weight: 500;
}

p {
  margin-bottom: 1rem;
}
p:last-child {
  margin-bottom: 0;
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  background-color: var(--color-cream);
  z-index: 10;
}

/* Ensure all blocks are above the fixed hero */
.site-main > * {
  position: relative;
  z-index: 1;
}

/* Remove default margins from first block */
.site-main > :first-child {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
}

/* Remove any padding from site-main that creates gaps */
.site-main {
  padding-top: 0 !important;
  padding-bottom: 0;
}


/* =============================================
   SKIP LINK (Accessibility)
   ============================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--size-sm);
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
}

/* Site header / navigation lives entirely in assets/css/nav.css */

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: var(--size-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary-green);
  color: #fff;
  border-color: var(--color-primary-green);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.btn-accent {
  background: var(--color-secondary-green);
  color: var(--color-primary-green);
  border-color: var(--color-secondary-green);
}
.btn-accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-green);
  border-color: var(--color-primary-green);
}
.btn-outline:hover {
  background: var(--color-primary-green);
  color: #fff;
}

/* =============================================
   Z-INDEX HIERARCHY (Layering)
   ============================================= */
/* 300: Navigation (top-most, always visible) */
/* 10:  Site Main / Content + Footer (scrolls above hero) */
/* 0:   Hero Block (fixed background, lowest layer) */

/* =============================================
   SITE FOOTER
   ============================================= */
.site-footer {
  background: var(--color-primary-green);
  color: rgba(255, 255, 255, 0.85);
  padding-block: var(--sp-12) var(--sp-6);
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.site-footer__widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-10);
  padding-bottom: var(--sp-10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: var(--sp-6);
}

.footer-widget-title {
  font-size: var(--size-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: var(--sp-4);
  font-family: var(--font-secondary);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
}
.site-footer a:hover {
  color: var(--color-accent);
}

.footer-nav {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-nav a {
  font-size: var(--size-sm);
  font-family: var(--font-secondary);
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--size-xs);
  color: rgba(255, 255, 255, 0.5);
}

.footer-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

/* =============================================
   CONTENT AREA
   ============================================= */
.entry-title {
  margin-bottom: var(--sp-6);
}
.entry-content {
  max-width: 72ch;
  font-family: var(--font-body);
}
.entry-content > * + * {
  margin-top: var(--sp-5);
}

/* =============================================
   WIDGETS
   ============================================= */
.widget {
  margin-bottom: 2rem;
}
.widget-title {
  font-size: var(--size-lg);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .primary-navigation {
    position: fixed;
    inset: 0 0 0 30%;
    background: var(--color-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 99;
  }

  .primary-navigation.is-open {
    transform: translateX(0);
  }

  .primary-navigation .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }

  .primary-navigation .nav-menu a {
    padding: 0.75rem 0;
    font-size: var(--size-base);
  }

  .primary-navigation .nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }

  .header-cta {
    display: none;
  }

  .site-footer__widgets {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .site-footer__widgets {
    grid-template-columns: 1fr;
  }
  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ── Archive hero (fastigheter + nyheter) ── */
.archive-hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: clamp(300px, 40vh, 440px);
  margin-top: -74px;
  background-color: #1e3a2f;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.archive-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,22,15,.65) 0%, rgba(10,22,15,.2) 60%, rgba(10,22,15,.35) 100%);
}

.archive-hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 74px 52px 0;
  /* Flex item: allow it to shrink below the longest word so the heading wraps
     instead of overflowing the viewport. */
  min-width: 0;
  max-width: 100%;
}

.archive-hero__eyebrow {
  font-family: 'SeasonSans', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin: 0 0 10px;
}

.archive-hero__heading {
  font-family: 'ConcretteXL', Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 400;
  color: #fff;
  margin: 0;
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  /* Long single words (e.g. "Bostadsutveckling") wrap instead of overflowing the
     viewport (anywhere also reduces the flex min-content size). */
  overflow-wrap: anywhere;
  hyphens: auto;
}

@media (max-width: 768px) {
  .archive-hero {
    height: clamp(240px, 34vh, 320px);
  }
  /* 74px top keeps the heading clear of the navbar. */
  .archive-hero__content {
    padding: 74px 28px 0;
  }
  .archive-hero__heading {
    font-size: clamp(2rem, 7vw, 3.2rem);
  }
}

@media (max-width: 480px) {
  .archive-hero {
    height: clamp(220px, 42vh, 300px);
  }
  .archive-hero__content {
    padding: 74px 20px 0;
  }
  .archive-hero__heading {
    font-size: clamp(1.7rem, 9vw, 2.6rem);
  }
}

/* ── Small Hero block — scroll-in reveal (JS adds .is-in) ── */
.wp-block-propcomm-small-hero-block .archive-hero__eyebrow,
.wp-block-propcomm-small-hero-block .archive-hero__heading {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(.16, 1, .3, 1),
              transform 0.8s cubic-bezier(.16, 1, .3, 1);
}
.wp-block-propcomm-small-hero-block.is-in .archive-hero__eyebrow { opacity: 1; transform: none; transition-delay: 0.10s; }
.wp-block-propcomm-small-hero-block.is-in .archive-hero__heading { opacity: 1; transform: none; transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .wp-block-propcomm-small-hero-block .archive-hero__eyebrow,
  .wp-block-propcomm-small-hero-block .archive-hero__heading { opacity: 1; transform: none; transition: none; }
}

/* ── Touch tap-target expansion ──────────────────────────────────────────
   Small text links get an invisible hit-area extension on touch devices so
   they meet the ~44px minimum without changing the visual design. */
@media (pointer: coarse) {
  .na__card-link,
  .fa__card-link,
  .tmb__bio-toggle,
  .footer-top-contact__link {
    position: relative;
  }

  .na__card-link::before,
  .fa__card-link::before,
  .tmb__bio-toggle::before,
  .footer-top-contact__link::before {
    content: '';
    position: absolute;
    inset: -10px 0;
  }
}
