/*
Theme Name: Brf Uppsala Entré
Theme URI: https://www.brfuppsalaentre.se
Description: Tema för Brf Uppsala Entré med regnbågsidentitet baserad på föreningens sju huskroppar
Version: 1.0
Author: Vanilla Consulting
Text Domain: brf-uppsala-entre
*/

@import url('https://fonts.googleapis.com/css2?family=Cantarell:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* House Colors */
  --hus1: #E53935;
  --hus2: #FB8C00;
  --hus3: #F9A825;
  --hus4: #7CB342;
  --hus5: #2E7D32;
  --hus6: #1E88E5;
  --hus7: #8E24AA;

  /* Pastel versions */
  --hus1-pastel: #ec9494;
  --hus2-pastel: #e9c387;
  --hus3-pastel: #f0e895;
  --hus4-pastel: #88e98d;
  --hus5-pastel: #4f9b55;
  --hus6-pastel: #87c2ec;
  --hus7-pastel: #d4aff7;

  /* Rainbow gradient */
  --rainbow: linear-gradient(90deg,
    var(--hus1) 0%,
    var(--hus2) 16%,
    var(--hus3) 30%,
    var(--hus4) 44%,
    var(--hus5) 58%,
    var(--hus6) 72%,
    var(--hus7) 100%
  );

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
--font-display: 'Cantarell', sans-serif;
--font-body: 'Cantarell', sans-serif;

  /* Spacing */
  --section-py: clamp(3rem, 6vw, 6rem);
  --container-px: clamp(1rem, 5vw, 2rem);
  --max-width: 1200px;
  --radius: 1rem;
  --radius-sm: 0.5rem;

  /* Shadows */
  --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.14);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

/* ============================================
   RAINBOW STRIPE
   ============================================ */
.rainbow-stripe {
  height: 4px;
  background: var(--rainbow);
  width: 100%;
}

/* ============================================
   NAVIGATION
   ============================================ */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.3s;
}

#site-header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.1); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.site-logo span {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--gray-400);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active { color: var(--gray-900); }

.nav-cta {
  background: var(--hus6);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  font-weight: 600 !important;
  transition: background 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
  background: var(--hus7) !important;
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-top: 1px solid var(--gray-100);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  .nav-cta {
    margin: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
  }
}

/* ============================================
   MAIN CONTENT OFFSET
   ============================================ */
#page { padding-top: 68px; }

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: clamp(480px, 70vh, 700px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gray-800);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 2.5rem 3rem;
  max-width: 780px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
}

.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-content .hero-sub {
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.8;
  font-family: var(--font-body);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  opacity: 0.9;
  line-height: 1.7;
  font-weight: 300;
}

/* ============================================
   CARDS GRID (startsida)
   ============================================ */
.cards-section {
  padding: var(--section-py) 0;
  background: var(--gray-50);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  border-top: 5px solid;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.contact-card--red   { border-top-color: var(--hus1); }
.contact-card--orange   { border-top-color: var(--hus2); }
.contact-card--yellow { border-top-color: var(--hus3); }
.contact-card--green { border-top-color: var(--hus4); }
.contact-card--darkgreen { border-top-color: var(--hus5); }
.contact-card--blue { border-top-color: var(--hus6); }
.contact-card--purple { border-top-color: var(--hus7); }

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.contact-card--red   .card-icon { background: var(--hus1-pastel); color: var(--hus1); }
.contact-card--orange .card-icon { background: var(--hus2-pastel); color: var(--hus2); }
.contact-card--yellow .card-icon { background: var(--hus3-pastel); color: var(--hus3); }
.contact-card--green .card-icon { background: var(--hus4-pastel); color: var(--hus4); }
.contact-card--darkgreen .card-icon { background: var(--hus5-pastel); color: var(--hus5); }
.contact-card--blue .card-icon { background: var(--hus6-pastel); color: var(--hus6); }
.contact-card--purple .card-icon { background: var(--hus7-pastel); color: var(--hus7); }

.contact-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}

.contact-card p {
  color: var(--gray-600);
  line-height: 1.65;
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  width: fit-content;
}

.btn--red    { background: var(--hus1); color: var(--white); }
.btn--orange { background: var(--hus2); color: var(--gray-900); }
.btn--yellow { background: var(--hus3); color: var(--gray-900); }
.btn--green { background: var(--hus4); color: var(--gray-900); }
.btn--darkgreen { background: var(--hus5); color: var(--white); }
.btn--blue   { background: var(--hus6); color: var(--white); }
.btn--purple { background: var(--hus7); color: var(--white); }
.btn--dark   { background: var(--gray-800); color: var(--white); }
.btn--outline { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-200); }

.btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================
   QUICK INFO (startsida)
   ============================================ */
.quick-info {
  padding: var(--section-py) 0;
  background: var(--white);
  text-align: center;
}

.quick-info h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}

.quick-info p {
  color: var(--gray-600);
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.75;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.pill {
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.pill--1 { background: var(--hus1-pastel); color: var(--hus1); }
.pill--2 { background: var(--hus2-pastel); color: var(--hus2); }
.pill--3 { background: var(--hus3-pastel); color: #8a6d00; }
.pill--4 { background: var(--hus4-pastel); color: var(--hus5); }

/* ============================================
   PAGE HERO (inner pages)
   ============================================ */
.page-hero {
  padding: 4rem 0 3rem;
  background: var(--gray-50);
  text-align: center;
}

.page-hero--image {
  position: relative;
  padding: 0;
  min-height: clamp(340px, 50vh, 500px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray-800);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.page-hero-card {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  max-width: 680px;
  margin: 3rem auto;
  padding: 2.5rem 3rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.page-hero-card .page-hero-icon {
  margin: 0 auto 1.25rem;
}

.page-hero-card h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  margin-bottom: 0.75rem;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.page-hero-card p {
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

.page-hero-card .updated {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.03em;
}

.page-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: var(--gray-600);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

.page-hero .updated {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--gray-400);
}

/* Override for image heroes – white text on dark backdrop */
.page-hero--image h1 {
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.page-hero--image p {
  color: rgba(255,255,255,0.88);
}

.page-hero--image .updated {
  color: rgba(255,255,255,0.55);
}

/* ============================================
   FAQ PAGE
   ============================================ */
.faq-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--rainbow);
  z-index: 3;
}

.faq-section {
  padding: var(--section-py) 0;
}

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  overflow: hidden;
}

.faq-item:nth-child(7n+1) { border-left-color: var(--hus1); }
.faq-item:nth-child(7n+2) { border-left-color: var(--hus2); }
.faq-item:nth-child(7n+3) { border-left-color: var(--hus3); }
.faq-item:nth-child(7n+4) { border-left-color: var(--hus4); }
.faq-item:nth-child(7n+5) { border-left-color: var(--hus5); }
.faq-item:nth-child(7n+6) { border-left-color: var(--hus6); }
.faq-item:nth-child(7n+0) { border-left-color: var(--hus7); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  transition: background 0.2s;
}

.faq-question:hover { background: rgba(0,0,0,0.02); }

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform 0.3s;
}

.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-600);
  line-height: 1.75;
  font-size: 0.95rem;
  padding-top: 1rem;
}

/* ============================================
   OM FÖRENINGEN
   ============================================ */
.forening-section {
  padding: var(--section-py) 0;
}

.forening-section h2,
.docs-section h2 {
  text-align: center;
}

.facts-table {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 1.5rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
}

.fact-row:nth-child(even) {
  border-right: none;
}

.fact-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.fact-row--alt {
  background: var(--gray-50);
}

@media (max-width: 600px) {
  .facts-table {
    grid-template-columns: 1fr;
  }
  .fact-row {
    border-right: none;
  }
  .fact-row:last-child {
    border-bottom: none;
  }
}

.fact-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
}

.fact-value {
  font-weight: 600;
  color: var(--gray-800);
  text-align: right;
  font-size: 0.95rem;
}

/* Documents */
.docs-section {
  padding: var(--section-py) 0;
  background: var(--gray-50);
}

.doc-category {
  margin-bottom: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.doc-category:hover {
  box-shadow: var(--shadow-card);
}

.doc-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
}

.doc-category-header:hover {
  background: var(--gray-50);
}

.doc-category-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.doc-category h3 {
  font-size: 1.15rem;
  font-family: var(--font-display);
  flex: 1;
  text-align: left;
  margin: 0;
}

.doc-count {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}

.doc-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform 0.3s;
}

.doc-category.open .doc-chevron {
  transform: rotate(180deg);
}

.doc-category-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.doc-category-body-inner {
  padding: 0 1.5rem 1.5rem;
}

.doc-card {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  border-left: 4px solid;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.doc-card:hover { box-shadow: var(--shadow-card); }

.doc-info { flex: 1; min-width: 0; }

.doc-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.doc-year {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 0.9rem;
}

.doc-desc {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.doc-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.doc-card--text {
  flex-direction: column;
  align-items: flex-start;
}

.doc-textinfo {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.75;
}

.doc-textinfo p {
  margin-bottom: 0.75rem;
}

.doc-textinfo p:last-child {
  margin-bottom: 0;
}

.doc-textinfo ul,
.doc-textinfo ol {
  margin: 0.5rem 0 0.75rem 1.5rem;
}

.doc-textinfo li {
  margin-bottom: 0.25rem;
}

.doc-textinfo a {
  color: var(--hus6);
  text-decoration: underline;
}

.doc-textinfo a:hover {
  color: var(--hus7);
}

.doc-textinfo strong {
  color: var(--gray-800);
}

.doc-textinfo h3,
.doc-textinfo h4 {
  margin: 1rem 0 0.5rem;
  color: var(--gray-800);
}

/* Category colors */
.cat-stadgar    .doc-category-icon { background: var(--hus5-pastel); color: var(--hus5); }
.cat-stadgar    .doc-card          { border-left-color: var(--hus5); }
.cat-ars        .doc-category-icon { background: var(--hus6-pastel); color: var(--hus6); }
.cat-ars        .doc-card          { border-left-color: var(--hus6); }
.cat-protokoll  .doc-category-icon { background: var(--hus7-pastel); color: var(--hus7); }
.cat-protokoll  .doc-card          { border-left-color: var(--hus7); }
.cat-styrelse   .doc-category-icon { background: var(--hus3-pastel); color: #8a6d00; }
.cat-styrelse   .doc-card          { border-left-color: var(--hus3); }
.cat-ovriga     .doc-category-icon { background: var(--hus2-pastel); color: var(--hus2); }
.cat-ovriga     .doc-card          { border-left-color: var(--hus2); }

/* ============================================
   CONTACT CTA
   ============================================ */
.cta-section {
  padding: var(--section-py) 0;
  background: var(--white);
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.cta-section p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
#site-footer {
  background: var(--gray-900);
  color: var(--white);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  padding: 4rem 0 3rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--white);
}

.footer-col p,
.footer-col a {
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.9;
  display: block;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--white); }

.footer-social {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  color: #60a5fa;
}

.footer-social svg { flex-shrink: 0; }

.footer-social:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid #374151;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .doc-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-actions { width: 100%; }
  .doc-actions .btn { flex: 1; justify-content: center; }
}
