/* ============================================================
   girona.services — Main Stylesheet  v1.0.0
   Mobile-first, minimal, production-ready
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --clr-bg:          #ffffff;
  --clr-surface:     #f8fafc;
  --clr-border:      #e2e8f0;
  --clr-text:        #0f172a;
  --clr-muted:       #64748b;
  --clr-primary:     #2563eb;
  --clr-primary-hov: #1d4ed8;
  --clr-wa:          #25d366;
  --clr-wa-hov:      #1ebe5d;
  --clr-tg:          #0088cc;
  --clr-tg-hov:      #007ab8;
  --radius:          0.5rem;
  --shadow-sm:       0 1px 2px rgba(0,0,0,.05);
  --shadow:          0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:       0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --font:            system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-w:           1100px;
  --header-h:        60px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html                   { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size:   1rem;
  line-height: 1.6;
  color:       var(--clr-text);
  background:  var(--clr-bg);
  -webkit-font-smoothing: antialiased;
}
img            { max-width: 100%; height: auto; display: block; }
a              { color: var(--clr-primary); text-decoration: none; }
a:hover        { text-decoration: underline; }
ul, ol         { list-style: none; }
button         { font-family: inherit; }

/* ── Utility ────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
.text-center { text-align: center; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 1rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position:      sticky;
  top:           0;
  z-index:       200;
  height:        var(--header-h);
  background:    var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  box-shadow:    var(--shadow-sm);
}
.site-header .container {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  height:          100%;
  gap:             1rem;
}

/* Logo */
.logo {
  font-size:      1.2rem;
  font-weight:    800;
  color:          var(--clr-text);
  letter-spacing: -.02em;
  flex-shrink:    0;
}
.logo:hover     { text-decoration: none; }
.logo span      { color: var(--clr-primary); }

/* Hamburger */
.nav-toggle {
  display:         flex;
  flex-direction:  column;
  justify-content: space-between;
  width:           24px;
  height:          18px;
  background:      none;
  border:          none;
  cursor:          pointer;
  padding:         0;
  flex-shrink:     0;
}
.nav-toggle span {
  display:       block;
  width:         100%;
  height:        2px;
  background:    var(--clr-text);
  border-radius: 2px;
  transition:    transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile nav */
.main-nav {
  display:        none;
  position:       absolute;
  top:            var(--header-h);
  left:           0;
  right:          0;
  background:     var(--clr-bg);
  border-bottom:  1px solid var(--clr-border);
  padding:        1rem;
  flex-direction: column;
  gap:            .5rem;
  box-shadow:     var(--shadow);
}
.main-nav.is-open { display: flex; }
.main-nav .nav-link {
  font-weight: 500;
  color:       var(--clr-text);
  padding:     .25rem 0;
}
.main-nav .nav-link:hover { color: var(--clr-primary); text-decoration: none; }

/* Desktop nav */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .main-nav {
    display:        flex !important;
    position:       static;
    flex-direction: row;
    align-items:    center;
    gap:            1.5rem;
    border-bottom:  none;
    padding:        0;
    background:     none;
    box-shadow:     none;
  }
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display:         inline-flex;
  align-items:     center;
  gap:             .4rem;
  padding:         .625rem 1.25rem;
  border-radius:   var(--radius);
  font-size:       .95rem;
  font-weight:     600;
  cursor:          pointer;
  border:          none;
  text-decoration: none;
  transition:      background-color .15s, box-shadow .15s, color .15s;
  white-space:     nowrap;
}
.btn:hover { text-decoration: none; }

.btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.btn-sm { padding: .4rem .85rem; font-size: .85rem; }
.btn-sm svg { width: 16px; height: 16px; }

.btn-primary     { background: var(--clr-primary);  color: #fff; }
.btn-primary:hover { background: var(--clr-primary-hov); color: #fff; }

.btn-whatsapp    { background: var(--clr-wa);  color: #fff; }
.btn-whatsapp:hover { background: var(--clr-wa-hov); color: #fff; }

.btn-telegram    { background: var(--clr-tg);  color: #fff; }
.btn-telegram:hover { background: var(--clr-tg-hov); color: #fff; }

.btn-outline {
  background:  transparent;
  color:       var(--clr-primary);
  border:      2px solid var(--clr-primary);
}
.btn-outline:hover { background: var(--clr-primary); color: #fff; }

.btn-block { width: 100%; justify-content: center; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 3.5rem 0;
  text-align: center;
}
.hero h1 {
  font-size:      clamp(1.75rem, 5vw, 2.75rem);
  font-weight:    800;
  line-height:    1.2;
  margin-bottom:  .75rem;
  letter-spacing: -.02em;
}
.hero p {
  color:          var(--clr-muted);
  max-width:      560px;
  margin:         0 auto 2rem;
  font-size:      1.05rem;
}
.hero-actions {
  display:         flex;
  gap:             .75rem;
  justify-content: center;
  flex-wrap:       wrap;
}

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 3rem 0; }

.section-header {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             1rem;
  margin-bottom:   1.5rem;
}
.section-header h2 {
  font-size:   1.5rem;
  font-weight: 700;
}
.section-more { font-size: .9rem; color: var(--clr-primary); }

/* ── Page Title ─────────────────────────────────────────────── */
.page-title {
  padding:       1.5rem 0 1rem;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 2rem;
}
.page-title h1     { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.page-title__sub   { color: var(--clr-muted); margin-top: .25rem; }

/* ── Posts Grid ─────────────────────────────────────────────── */
.posts-grid {
  display:               grid;
  gap:                   1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .posts-grid           { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .posts-grid           { grid-template-columns: repeat(3, 1fr); }
  .posts-grid--2col     { grid-template-columns: repeat(2, 1fr); }
  .posts-grid--3col     { grid-template-columns: repeat(3, 1fr); }
}

/* ── Post Card ──────────────────────────────────────────────── */
.post-card {
  background:    var(--clr-bg);
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow:      hidden;
  display:       flex;
  flex-direction: column;
  transition:    box-shadow .15s, transform .15s;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.post-card__img { display: block; overflow: hidden; }
.post-card__img img {
  width:         100%;
  aspect-ratio:  16/9;
  object-fit:    cover;
  transition:    transform .3s;
}
.post-card:hover .post-card__img img { transform: scale(1.03); }

.post-card__body   { padding: 1.1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .45rem; }
.post-card__cat {
  font-size:       .7rem;
  font-weight:     700;
  text-transform:  uppercase;
  letter-spacing:  .06em;
  color:           var(--clr-primary);
}
.post-card__cat:hover { text-decoration: underline; }
.post-card__title,
.post-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; margin: 0; }
.post-card__title a,
.post-card h3 a { color: var(--clr-text); }
.post-card__title a:hover,
.post-card h3 a:hover { color: var(--clr-primary); text-decoration: none; }
.post-card__excerpt {
  font-size:          .875rem;
  color:              var(--clr-muted);
  display:            -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:           hidden;
  flex:               1;
}
.post-card__date { font-size: .775rem; color: var(--clr-muted); margin-top: auto; }

/* ── Blog Layout ────────────────────────────────────────────── */
.blog-layout { display: grid; gap: 2rem; padding-top: .5rem; }
@media (min-width: 900px) {
  .blog-layout { grid-template-columns: 1fr 270px; }
}
.blog-main { min-width: 0; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {}

.sidebar-widget {
  background:    var(--clr-bg);
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  padding:       1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.sidebar-widget h3 {
  font-size:      .7rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color:          var(--clr-muted);
  margin-bottom:  .875rem;
  padding-bottom: .5rem;
  border-bottom:  1px solid var(--clr-border);
}

.sidebar-list {
  display:        flex;
  flex-direction: column;
  gap:            .5rem;
}
.sidebar-list li {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  gap:             .5rem;
}
.sidebar-list a { color: var(--clr-text); font-size: .875rem; line-height: 1.4; }
.sidebar-list a:hover { color: var(--clr-primary); text-decoration: none; }
.sidebar-list .count {
  font-size:   .75rem;
  color:       var(--clr-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Search form inside sidebar */
.search-form { display: flex; gap: .4rem; }
.search-form input {
  flex:          1;
  padding:       .5rem .75rem;
  border:        1px solid var(--clr-border);
  border-radius: var(--radius);
  font-size:     .875rem;
  outline:       none;
  transition:    border-color .15s;
  background:    var(--clr-bg);
  color:         var(--clr-text);
  min-width:     0;
}
.search-form input:focus { border-color: var(--clr-primary); }
.search-form button {
  padding:       .5rem .75rem;
  background:    var(--clr-primary);
  color:         #fff;
  border:        none;
  border-radius: var(--radius);
  cursor:        pointer;
  transition:    background-color .15s;
  flex-shrink:   0;
}
.search-form button svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.search-form button:hover { background: var(--clr-primary-hov); }

/* ── Post Single ────────────────────────────────────────────── */
.post-single { min-width: 0; }

.post-single__hero {
  border-radius:  var(--radius);
  overflow:       hidden;
  margin-bottom:  1.5rem;
}
.post-single__hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.post-single__header { margin-bottom: 1.75rem; }
.post-single__meta {
  display:     flex;
  align-items: center;
  gap:         .75rem;
  flex-wrap:   wrap;
  margin-bottom: .5rem;
  font-size:   .875rem;
  color:       var(--clr-muted);
}
.post-single__header h1 {
  font-size:      clamp(1.5rem, 4vw, 2rem);
  font-weight:    800;
  letter-spacing: -.02em;
  line-height:    1.25;
  margin-bottom:  .75rem;
}
.post-single__lead { font-size: 1.1rem; color: var(--clr-muted); }

/* Post content typography */
.post-content { font-size: 1rem; line-height: 1.75; max-width: 720px; }
.post-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 .75rem; letter-spacing: -.01em; }
.post-content h3 { font-size: 1.2rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
.post-content h4 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.post-content p,
.post-content ul,
.post-content ol { margin-bottom: 1.25rem; }
.post-content ul,
.post-content ol { padding-left: 1.5rem; list-style: revert; }
.post-content li { margin-bottom: .25rem; }
.post-content a  { color: var(--clr-primary); text-decoration: underline; }
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.post-content blockquote {
  border-left:   3px solid var(--clr-primary);
  padding:       .75rem 1.25rem;
  margin:        1.5rem 0;
  background:    var(--clr-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color:         var(--clr-muted);
}
.post-content code {
  background:    var(--clr-surface);
  padding:       .1rem .35rem;
  border-radius: .25rem;
  font-size:     .875em;
}
.post-content pre {
  background:    var(--clr-surface);
  padding:       1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x:    auto;
  margin:        1.5rem 0;
}
.post-content pre code { background: none; padding: 0; }
.post-content table {
  width:           100%;
  border-collapse: collapse;
  margin:          1.5rem 0;
  font-size:       .9rem;
}
.post-content th,
.post-content td { border: 1px solid var(--clr-border); padding: .5rem .75rem; text-align: left; }
.post-content th  { background: var(--clr-surface); font-weight: 700; }

/* ── Related Posts ──────────────────────────────────────────── */
.related-posts {
  margin-top:    3rem;
  padding-top:   2rem;
  border-top:    1px solid var(--clr-border);
}
.related-posts h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ── Breadcrumbs ────────────────────────────────────────────── */
.breadcrumbs { padding: .75rem 0; }
.breadcrumbs ol {
  display:   flex;
  flex-wrap: wrap;
  gap:       .2rem;
}
.breadcrumbs li {
  display:     flex;
  align-items: center;
  font-size:   .8rem;
}
.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color:   var(--clr-muted);
  margin:  0 .25rem;
}
.breadcrumbs a  { color: var(--clr-muted); }
.breadcrumbs a:hover { color: var(--clr-primary); }
.breadcrumbs span { color: var(--clr-muted); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display:         flex;
  flex-wrap:       wrap;
  gap:             .3rem;
  margin-top:      2rem;
  justify-content: center;
}
.pagination a,
.pagination span {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  min-width:       2.25rem;
  height:          2.25rem;
  padding:         0 .5rem;
  border:          1px solid var(--clr-border);
  border-radius:   var(--radius);
  font-size:       .875rem;
  color:           var(--clr-text);
  text-decoration: none;
  transition:      background-color .1s;
}
.pagination a:hover { background: var(--clr-surface); text-decoration: none; }
.pagination .current {
  background:   var(--clr-primary);
  color:        #fff;
  border-color: var(--clr-primary);
  font-weight:  700;
}
.pagination .disabled { color: var(--clr-muted); cursor: default; }
.pagination .dots     { border-color: transparent; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  padding:       2rem 0;
  color:         var(--clr-muted);
  text-align:    center;
  font-size:     .95rem;
}

/* ── Error Page ─────────────────────────────────────────────── */
.error-page {
  padding:    5rem 0;
  text-align: center;
}
.error-page h1 {
  font-size:     6rem;
  font-weight:   800;
  color:         var(--clr-border);
  line-height:   1;
  margin-bottom: .5rem;
}
.error-page p  { color: var(--clr-muted); margin-bottom: 1.5rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  margin-top:    4rem;
  padding:       1.75rem 0;
  background:    var(--clr-surface);
  border-top:    1px solid var(--clr-border);
  text-align:    center;
  color:         var(--clr-muted);
  font-size:     .85rem;
}
.site-footer a  { color: var(--clr-muted); }
.site-footer a:hover { color: var(--clr-primary); }

/* ── Floating Bot Buttons ───────────────────────────────────── */
.bot-float {
  position:       fixed;
  bottom:         1.25rem;
  right:          1.25rem;
  display:        flex;
  flex-direction: column;
  gap:            .6rem;
  z-index:        300;
}
.bot-float__btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           50px;
  height:          50px;
  border-radius:   50%;
  color:           #fff;
  text-decoration: none;
  box-shadow:      0 2px 8px rgba(0,0,0,.18);
  transition:      transform .2s, box-shadow .2s;
}
.bot-float__btn:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.2); color: #fff; text-decoration: none; }
.bot-float__btn svg   { width: 24px; height: 24px; fill: currentColor; }
.bot-float__btn--wa   { background: var(--clr-wa); }
.bot-float__btn--tg   { background: var(--clr-tg); }
