/*
Theme Name: BitWeb Minimal
Theme URI: https://bitweb.it
Author: BitWeb
Description: Layout a tre colonne ispirato a Kathy
Version: 6.4.0
Text Domain: bitweb
*/

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

:root {
  --blu:    #1A5DC8;
  --giallo: #F5C800;
  --nero:   #111111;
  --grigio: #BBBBBB;
  --linea:  #E0E0E0;
  --font:   'Satoshi', 'DM Sans', -apple-system, sans-serif;

  /* distanza fissa tra ogni colonna laterale e il contenuto centrale */
  --gap-colonne: 1.5rem;

  /* padding-top condiviso — allinea il primo elemento di tutte le colonne */
  --col-top: 3rem;
}

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--nero);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ============================================================
   LAYOUT DESKTOP — 3 colonne (stile Kathy)
   ============================================================ */
.bw-wrap {
  display: flex;
  min-height: 100vh;
  gap: 0;
}

/* — colonna sinistra — si espande ma il testo è allineato a destra, vicino al centro */
.bw-col-left {
  flex: 1;
  min-width: 0;
  padding: var(--col-top) 40px var(--col-top) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* — colonna centrale — larghezza fissa, non cresce */
.bw-col-center {
  width: 680px;
  flex-shrink: 0;
  min-width: 0;
}

/* — colonna destra — si espande ma il testo parte da sinistra, vicino al centro */
.bw-col-right {
  flex: 1;
  min-width: 0;
  padding: var(--col-top) 0 var(--col-top) 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   COLONNA SINISTRA — filtri
   ============================================================ */
.bw-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0;
}

.bw-cat-list a {
  font-size: 13px;
  font-weight: 400;
  color: var(--grigio);
  line-height: 1.9;
  letter-spacing: 0.2px;
  transition: color 0.2s;
}

.bw-cat-list a:hover       { color: var(--nero); }
.bw-cat-list a.current     { color: var(--nero); font-weight: 700; }

.bw-cat-list a.current::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--giallo);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============================================================
   COLONNA DESTRA — nav
   ============================================================ */
.bw-site-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--nero);
  text-transform: uppercase;
}

.bw-hr {
  border: none;
  border-top: 1px solid var(--blu);
  margin: 0.75rem 0;
}

.bw-hr--giallo {
  border-top-color: var(--giallo);
  margin: 1rem 0;
}

.bw-nav-list a {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grigio);
  line-height: 2.4;
  transition: color 0.2s;
}
.bw-nav-list a:hover { color: var(--nero); }
.bw-nav-list ul { list-style: none; padding: 0; margin: 0; }

.bw-social {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.bw-social a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grigio);
  transition: color 0.2s;
}
.bw-social a:hover  { color: var(--nero); }
.bw-social__sep     { color: var(--grigio); font-size: 11px; }

.bw-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--grigio);
  text-transform: uppercase;
  padding: 0;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.bw-search-btn:hover { color: var(--nero); }

.bw-copyright {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--grigio);
  margin-top: auto;
  padding-top: 1.5rem;
  line-height: 1.7;
  text-transform: uppercase;
}

/* ============================================================
   LISTA PROGETTI — colonna centrale
   ============================================================ */
.bw-posts {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--col-top);
  padding-bottom: 3rem;
}

/* ogni riga è un flex che centra orizzontalmente il link */
.bw-post-item {
  margin-bottom: 3.5rem;
}

/* il link si adatta al contenuto (immagine) */
.bw-post-item--image {
  display: inline-block;
  cursor: pointer;
  line-height: 0; /* elimina spazio sotto img */
}

/* contenitore immagine con overlay */
.bw-post-item__thumb-wrap {
  position: relative;
  width: 100%;
  max-width: 680px;
  overflow: hidden;
}

.bw-post-item__thumb-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.bw-post-item--image:hover .bw-post-item__thumb-wrap img {
  transform: scale(1.03);
}

/* titolo sovrapposto in basso */
.bw-post-item__overlay-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.3;
}

/* card senza immagine */
.bw-post-item--text {
  display: block;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 680px;
}
.bw-post-item__cat {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grigio);
  display: block;
  margin-bottom: 0.5rem;
}
.bw-post-item__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.bw-post-item__excerpt {
  font-size: 14px;
  color: var(--grigio);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.bw-post-item__meta {
  font-size: 11px;
  color: var(--grigio);
  letter-spacing: 1px;
}

/* paginazione */
.bw-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
}
.bw-pagination a,
.bw-pagination span {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--grigio);
  padding: 0.25rem 0.5rem;
}
.bw-pagination .current { color: var(--nero); font-weight: 700; }

/* ============================================================
   MOBILE HEADER (nascosto su desktop)
   ============================================================ */
.bw-mobile-header  { display: none; }
.bw-mobile-filters { display: none; }
.bw-mobile-nav     { display: none; }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.bw-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.bw-search-overlay.is-open { display: flex; }

.bw-search-overlay__close {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--nero);
  line-height: 1;
}

.bw-search-overlay__form {
  width: 70%;
  max-width: 800px;
  text-align: center;
}

.bw-search-overlay__input {
  width: 100%;
  font-family: var(--font);
  font-size: clamp(24px, 4vw, 48px);
  color: #999;
  border: none;
  border-bottom: 1px solid var(--linea);
  outline: none;
  text-align: center;
  padding: 0.5rem 0 1rem;
  background: transparent;
}
.bw-search-overlay__input::placeholder { color: #ccc; }

/* backdrop menu mobile */
.bw-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1999;
}
.bw-nav-backdrop.is-visible { display: block; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.bw-single {
  padding: 3rem 3rem 5rem;
  max-width: 760px;
}
.bw-single__back {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grigio);
  display: inline-block;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.bw-single__back:hover { color: var(--nero); }
.bw-single__cat {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grigio);
  display: block;
  margin-bottom: 0.5rem;
}
.bw-single__title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.bw-single__date {
  font-size: 11px;
  color: var(--grigio);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 2rem;
}
.bw-single__thumb {
  width: 100%;
  height: auto;
  margin-bottom: 2.5rem;
}
.bw-single__content {
  font-size: 16px;
  line-height: 1.75;
  color: #333;
}
.bw-single__content p  { margin-bottom: 1.25rem; }
.bw-single__content h2 { font-size: 20px; font-weight: 600; margin: 2rem 0 0.75rem; }
.bw-single__footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linea);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   PAGE
   ============================================================ */
.bw-page {
  padding: 3rem 3rem 5rem;
  max-width: 680px;
}
.bw-page h1 { font-size: 28px; font-weight: 700; margin-bottom: 1.5rem; }
.bw-page p  { font-size: 15px; line-height: 1.75; margin-bottom: 1rem; color: #333; }

/* ============================================================
   RESPONSIVE — schermi grandi (>1920px)
   ============================================================ */
@media (min-width: 1920px) {
  .bw-post-item__thumb-wrap { width: clamp(400px, 42vw, 780px); }
  .bw-post-item--text       { width: clamp(400px, 42vw, 780px); }
  .bw-col-left  { width: 200px; }
  .bw-col-right { width: 240px; }
}

@media (min-width: 2560px) {
  .bw-post-item__thumb-wrap { width: clamp(500px, 38vw, 1000px); }
  .bw-post-item--text       { width: clamp(500px, 38vw, 1000px); }
  .bw-col-left  { width: 240px; }
  .bw-col-right { width: 280px; }
}

/* ============================================================
   RESPONSIVE — tablet (< 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .bw-col-center { width: 480px; }
  .bw-col-left  { padding-right: 24px; }
  .bw-col-right { padding-left: 24px; }
  .bw-post-item__thumb-wrap { max-width: 480px; }
  .bw-post-item--text       { max-width: 480px; }
}

/* ============================================================
   RESPONSIVE — mobile (< 860px) → hamburger
   ============================================================ */
@media (max-width: 860px) {

  /* nascondi layout desktop */
  .bw-wrap { display: block; }
  .bw-col-left  { display: none; }
  .bw-col-right { display: none; }

  /* mostra elementi mobile */
  .bw-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--linea);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
  }

  .bw-mobile-logo {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
  }

  .bw-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* filtri orizzontali */
  .bw-mobile-filters {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--linea);
    flex-wrap: wrap;
  }
  .bw-mobile-filters a {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--grigio);
    text-transform: lowercase;
    transition: color 0.2s;
  }
  .bw-mobile-filters a.current   { color: var(--nero); font-weight: 700; }
  .bw-mobile-filters__sep        { color: var(--grigio); font-size: 11px; }

  /* nav overlay */
  .bw-mobile-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 2000;
    padding: 4rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .bw-mobile-nav.is-open { transform: translateX(0); }

  .bw-mobile-nav a {
    font-size: clamp(28px, 7vw, 48px);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--nero);
    line-height: 1.4;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--linea);
  }

  .bw-mobile-nav__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--nero);
  }

  .bw-mobile-nav__bottom {
    margin-top: auto;
    padding-top: 1.5rem;
  }

  /* immagini mobile: quasi full width */
  .bw-post-item__thumb-wrap { width: 90vw; }
  .bw-post-item--text       { width: 90vw; padding: 1.5rem 0; }

  .bw-single { padding: 1.5rem 1.25rem 3rem; }
  .bw-page   { padding: 1.5rem 1.25rem 3rem; }
}
