/* =================================================================
   Anna Kowalska — Pośrednik Nieruchomości Katowice
   Static POC stylesheet. Plain CSS3, mobile-first.
   ================================================================= */

/* ---------------------------------------------------------------
   1. Fonts
   --------------------------------------------------------------- */
@font-face {
  font-family: 'Cormorant Garant';
  src: url('../fonts/CormorantGarant-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garant';
  src: url('../fonts/CormorantGarant-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garant';
  src: url('../fonts/CormorantGarant-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------
   2. Design tokens
   --------------------------------------------------------------- */
:root {
  /* Colour palette */
  --color-bg:           #F0EDE6;
  --color-surface:      #FAF8F4;
  --color-text:         #1E1C1A;
  --color-text-muted:   #6B6560;
  --color-accent:       #8C6A4E;
  --color-accent-hover: #6E5140;
  --color-divider:      #DDD8D0;

  /* Typography */
  --font-heading: 'Cormorant Garant', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing scale */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1100px;
  --prose-width: 68ch;
  --section-pad: clamp(4rem, 8vw, 7rem);
  --body-pad: clamp(1.25rem, 5vw, 2.5rem);
  --nav-height: 4rem; /* fixed bar height, referenced by hero offset */
}

/* ---------------------------------------------------------------
   3. Reset & base
   --------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* offset anchored scroll so fixed nav doesn't overlap section tops */
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem; /* 16px base */
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture {
  display: block;
  max-width: 100%;
}

/* Preserve aspect ratio when width/height attributes are present and the
   rendered width is constrained (prevents vertical stretch on portrait images).
   More specific rules (hero cover crop) override this where needed. */
img {
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: var(--color-accent-hover);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text);
}

ul[role="list"] {
  list-style: none;
}

/* Keyboard focus ring in accent colour */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------
   4. Reusable layout helpers
   --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--body-pad);
}

.section {
  padding-block: var(--section-pad);
}

/* Alternating section rhythm without borders */
.section--surface {
  background: var(--color-surface);
}

.section__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.section__heading {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: var(--space-lg);
}

.text-muted {
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------
   5. Buttons & links
   --------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0; /* square corners */
  cursor: pointer;
  transition: background-color 200ms ease;
}
.btn:hover,
.btn:focus-visible {
  background: var(--color-accent-hover);
  color: #ffffff;
}

.link-text {
  font-weight: 500;
  color: var(--color-accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 200ms ease;
}
.link-text:hover,
.link-text:focus-visible {
  color: var(--color-accent-hover);
}

/* ---------------------------------------------------------------
   6. Site header / navigation
   --------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}

.nav {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--body-pad);
  min-height: var(--nav-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--color-text);
  letter-spacing: 0.01em;
}
.nav__logo:hover,
.nav__logo:focus-visible {
  color: var(--color-accent);
}

/* CSS-only mobile menu driven by :target.
   The header carries id="menu"; the open control links to #menu, the close
   control and backdrop link to # (no target), and the nav links carry their
   own #section targets — so following any of them drops the #menu target and
   closes the menu, while still scrolling to the chosen anchor. */

/* Toggle controls (hamburger / close). Hamburger shown by default. */
.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
}
.nav__toggle:hover,
.nav__toggle:focus-visible {
  color: var(--color-accent);
}
.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
}
.nav__toggle--close {
  display: none; /* revealed only when the menu is open */
  font-size: 1.75rem;
  line-height: 1;
}

/* Backdrop closes the menu when tapping outside it. Hidden until open. */
.nav__backdrop {
  display: none;
}

.nav__list {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}
.nav__list a {
  font-size: 0.9rem;
  color: var(--color-text);
  transition: color 200ms ease;
}
.nav__list a:hover,
.nav__list a:focus-visible {
  color: var(--color-accent);
}

/* --- Mobile menu behaviour (default, mobile-first) --- */
@media (max-width: 767px) {
  .nav__list {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    /* collapsed by default */
    max-height: 0;
    overflow: hidden;
    transition: max-height 200ms ease;
  }
  .nav__list li {
    width: 100%;
  }
  .nav__list a {
    display: block;
    width: 100%;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--color-divider);
  }

  /* Menu open (header is the :target) -> reveal stacked list above the
     backdrop, swap hamburger for the close control. */
  .site-header:target .nav__list {
    max-height: 24rem; /* generous cap fits all items */
    padding-bottom: var(--space-sm);
  }
  .site-header:target .nav__toggle--open {
    display: none;
  }
  .site-header:target .nav__toggle--close {
    display: inline-flex;
  }
  .site-header:target ~ .nav__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1; /* below the header (z-index 100), above page content */
    background: rgba(30, 28, 26, 0.35); /* --color-text at 35% */
  }
}

/* On desktop the toggle controls and backdrop are irrelevant */
@media (min-width: 768px) {
  .nav__toggle,
  .nav__backdrop {
    display: none;
  }
  /* Keep the list visible even if a stray #menu target is present */
  .site-header:target .nav__list {
    max-height: none;
  }
}

/* ---------------------------------------------------------------
   7. Hero
   --------------------------------------------------------------- */
.hero {
  /* clear the fixed header */
  padding-top: calc(var(--nav-height) + var(--space-lg));
  padding-bottom: var(--space-2xl);
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: 100%;
}

.hero__title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.hero__lead {
  max-width: 52ch;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

/* Mobile: fixed-height image container with cover crop */
.hero__media {
  width: 100%;
  height: 18rem;
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 768px) {
  .hero__inner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2xl);
  }
  .hero__text {
    flex: 1 1 50%;
    /* text first column reads left */
    order: 1;
  }
  .hero__media {
    flex: 1 1 50%;
    height: auto;
    order: 2;
  }
  .hero__media img {
    height: auto;
    object-fit: initial;
  }
}

/* ---------------------------------------------------------------
   8. About
   --------------------------------------------------------------- */
.about__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.about__body p + p {
  margin-top: var(--space-sm);
}
.about__body {
  color: var(--color-text-muted);
}

@media (min-width: 768px) {
  .about__grid {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl);
  }
  .about__media {
    flex: 1 1 42%;
  }
  .about__body {
    flex: 1 1 58%;
  }
}

/* ---------------------------------------------------------------
   9. Services
   --------------------------------------------------------------- */
.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 768px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .services__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  padding: var(--space-md);
}
.service-card__title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-bottom: var(--space-xs);
}
.service-card__desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------
   10. Testimonials
   --------------------------------------------------------------- */
.testimonials__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
@media (min-width: 768px) {
  .testimonials__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.testimonial {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-md);
}
.testimonial__quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
.testimonial__author {
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------
   11. Contact
   --------------------------------------------------------------- */
.contact {
  text-align: center;
}
.contact__lead {
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
  color: var(--color-text-muted);
}
.contact__details {
  font-style: normal; /* reset <address> italics */
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-lg);
}
.contact__details a {
  font-size: 1.1rem;
  font-weight: 500;
}
.contact__area {
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------
   12. Blog listing & posts
   --------------------------------------------------------------- */
.page-head {
  padding-top: calc(var(--nav-height) + var(--space-xl));
  padding-bottom: var(--space-lg);
}
.page-head__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: var(--space-sm);
}
.page-head__intro {
  max-width: var(--prose-width);
  color: var(--color-text-muted);
}

/* Article list — rules, no card boxes */
.post-list {
  display: flex;
  flex-direction: column;
}
.post-list__item {
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-divider);
}
.post-list__item:last-child {
  border-bottom: 1px solid var(--color-divider);
}
.post-list__date {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}
.post-list__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: var(--space-xs);
}
.post-list__title a {
  color: var(--color-text);
  transition: color 200ms ease;
}
.post-list__title a:hover,
.post-list__title a:focus-visible {
  color: var(--color-accent);
}
.post-list__excerpt {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  max-width: var(--prose-width);
}

/* Single article prose */
.post {
  padding-top: calc(var(--nav-height) + var(--space-xl));
  padding-bottom: var(--space-2xl);
}
.post__header {
  max-width: var(--prose-width);
  margin-bottom: var(--space-lg);
}
.post__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: var(--space-sm);
}
.post__date {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.post__media {
  margin-bottom: var(--space-lg);
}
.post__media img {
  width: 100%;
  height: auto;
}
.post__body {
  max-width: var(--prose-width);
  line-height: 1.75;
}
.post__body p {
  margin-bottom: var(--space-md);
}
.post__body h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

/* ---------------------------------------------------------------
   13. Footer
   --------------------------------------------------------------- */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  text-align: center;
  padding-block: var(--space-xl);
}
.site-footer p {
  margin: 0;
}
.site-footer__name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}
.site-footer__meta {
  font-size: 0.875rem;
  color: var(--color-divider);
  margin-bottom: var(--space-xs);
}
.site-footer__copy {
  font-size: 0.875rem;
  color: var(--color-divider);
}

/* ---------------------------------------------------------------
   14. Reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Disable the short colour/opacity fades for motion-sensitive users.
     Listed selectors mirror every element that declares a transition above. */
  .btn,
  .link-text,
  .nav__logo,
  .nav__list a,
  .nav__toggle,
  .post-list__title a {
    transition: none;
  }
}
