/* ==========================================================================
   Repouso Cuidador — Main Stylesheet
   Mobile-first responsive design for a healthcare information site
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset / Normalize
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  list-style-position: outside;
}

a {
  color: inherit;
  text-decoration-skip-ink: auto;
}

/* --------------------------------------------------------------------------
   2. Design Tokens (Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Primary palette — calming healthcare blues/teals */
  --color-primary:       #1a7a6d; /* deep teal */
  --color-primary-dark:  #135e54;
  --color-primary-light: #e0f2ef;
  --color-accent:        #2a9d8f; /* brighter teal for links/accents */

  /* Neutrals */
  --color-text:          #2d3436;
  --color-text-muted:    #596275;
  --color-text-light:    #7f8c8d;
  --color-bg:            #ffffff;
  --color-bg-alt:        #f7fafa;
  --color-border:        #dce4e3;
  --color-border-dark:   #b2bec3;

  /* Semantic */
  --color-disclaimer-bg:    #fef9ec;
  --color-disclaimer-border:#e6d8a8;
  --color-disclaimer-text:  #6b5b2e;
  --color-focus:            #2a9d8f;

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif,
               "Apple Color Emoji", "Segoe UI Emoji";
  --font-heading: var(--font-body);

  --text-base:  1.0625rem;  /* 17px — comfortable for long-form reading */
  --text-sm:    0.9375rem;  /* 15px */
  --text-xs:    0.8125rem;  /* 13px */
  --text-lg:    1.1875rem;  /* 19px */
  --line-height: 1.7;

  /* Layout */
  --container-max: 1200px;
  --content-max: 800px;
  --container-pad: 1.25rem;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-8: 3rem;
  --sp-10: 4rem;
}

/* --------------------------------------------------------------------------
   3. Base Typography
   -------------------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-primary-dark);
  font-weight: 700;
}

h1 { font-size: 1.75rem; margin-bottom: var(--sp-4); }
h2 { font-size: 1.45rem; margin-top: var(--sp-8); margin-bottom: var(--sp-4); }
h3 { font-size: 1.2rem;  margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
h4 { font-size: 1.05rem; margin-top: var(--sp-5); margin-bottom: var(--sp-3); }
h5 { font-size: 0.95rem; margin-top: var(--sp-5); margin-bottom: var(--sp-2); }
h6 { font-size: 0.875rem; margin-top: var(--sp-5); margin-bottom: var(--sp-2); text-transform: uppercase; letter-spacing: 0.03em; }

p {
  margin-bottom: var(--sp-4);
}

strong {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Links & Focus States
   -------------------------------------------------------------------------- */
a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

/* Accessible focus ring — visible on keyboard navigation */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove outline on mouse click for elements that support :focus-visible */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   5. Layout — Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

main {
  flex: 1;
}

/* --------------------------------------------------------------------------
   6. Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: var(--sp-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-header .container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-title:hover {
  color: var(--color-primary-light);
}

/* Site logo / name — replaces .site-title in header.html */
.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color 0.15s ease;
}

.site-logo:hover {
  color: var(--color-primary-light);
}

.site-name {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Hamburger toggle — visible on mobile only */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* Navigation — hidden on mobile by default */
.site-nav {
  display: none;
  width: 100%;
}

.site-nav.is-open {
  display: flex;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  width: 100%;
}

.site-nav li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-nav li:last-child {
  border-bottom: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.site-nav a:focus-visible {
  outline-color: #ffffff;
}

/* --------------------------------------------------------------------------
   7. Article / Content Styles
   -------------------------------------------------------------------------- */
.content,
.article-body,
article {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
}

/* Lists inside article content */
article ul,
article ol,
.article-body ul,
.article-body ol,
.content ul,
.content ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-5);
}

article li,
.article-body li,
.content li {
  margin-bottom: var(--sp-2);
}

article li > ul,
article li > ol {
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* Blockquotes */
blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-bg-alt);
  color: var(--color-text-muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-size: 0.9em;
  background-color: var(--color-bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

pre {
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow-x: auto;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--sp-6) 0;
}

/* Images within content */
article img,
.content img {
  border-radius: 4px;
  margin: var(--sp-4) 0;
}

figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  text-align: center;
  margin-top: var(--sp-2);
}

/* Tables within content */
article table,
.content table {
  width: 100%;
  margin: var(--sp-5) 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

article th,
.content th {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  text-align: left;
}

article th,
article td,
.content th,
.content td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

article tr:last-child td,
.content tr:last-child td {
  border-bottom: none;
}

article tr:nth-child(even),
.content tr:nth-child(even) {
  background-color: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   8. Table of Contents
   -------------------------------------------------------------------------- */
.toc,
#TableOfContents,
.table-of-contents {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  padding-left: var(--sp-6);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  background-color: var(--color-bg-alt);
  border-radius: 0 4px 4px 0;
}

.toc-title,
.toc > strong,
.table-of-contents > strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: var(--sp-3);
}

.toc ul,
#TableOfContents ul,
.table-of-contents ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc ul ul,
#TableOfContents ul ul,
.table-of-contents ul ul {
  padding-left: var(--sp-4);
  margin-top: var(--sp-1);
}

.toc li,
#TableOfContents li,
.table-of-contents li {
  margin-bottom: var(--sp-1);
}

.toc a,
#TableOfContents a,
.table-of-contents a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.15s ease;
}

.toc a:hover,
#TableOfContents a:hover,
.table-of-contents a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. Disclaimer Box
   -------------------------------------------------------------------------- */
.disclaimer,
.aviso,
.aviso-legal {
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  background-color: var(--color-disclaimer-bg);
  border: 1px solid var(--color-disclaimer-border);
  border-radius: 4px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-disclaimer-text);
}

.disclaimer p:last-child,
.aviso p:last-child,
.aviso-legal p:last-child {
  margin-bottom: 0;
}

.disclaimer strong,
.aviso strong,
.aviso-legal strong {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--text-base);
  color: #5a4a1e;
}

/* --------------------------------------------------------------------------
   10. Article Meta (date, author, tags)
   -------------------------------------------------------------------------- */
.article-meta,
.post-meta {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0;
}

.tags a,
.tag {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: 3px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.tags a:hover,
.tag:hover {
  background-color: var(--color-border);
}

/* --------------------------------------------------------------------------
   10b. Single Post Layout
   -------------------------------------------------------------------------- */
.single-post {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  max-width: var(--content-max);
  margin-inline: auto;
}

.post-header {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}

.post-header h1 {
  margin-bottom: var(--sp-3);
}

.post-content {
  line-height: var(--line-height);
}

.post-content > *:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   11. Article List (homepage or section pages)
   -------------------------------------------------------------------------- */
.article-list {
  list-style: none;
  padding: 0;
}

.article-list li {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.article-list li:last-child {
  border-bottom: none;
}

.article-list a {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-primary-dark);
}

.article-list a:hover {
  color: var(--color-accent);
}

.article-list time {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-top: var(--sp-1);
}

.article-summary {
  margin-top: var(--sp-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   11b. Section List Pages (list.html)
   -------------------------------------------------------------------------- */
.section-list {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  max-width: var(--content-max);
  margin-inline: auto;
}

.section-header {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 2px solid var(--color-primary-light);
}

.section-header h1 {
  margin-bottom: var(--sp-3);
}

.section-description {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1.6;
  margin-bottom: 0;
}

/* Post list — shared between list pages and homepage */
.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item a {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--color-primary-dark);
  transition: color 0.15s ease;
}

.post-item a:hover {
  color: var(--color-accent);
}

.post-item time {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-top: var(--sp-1);
}

.post-summary {
  margin-top: var(--sp-2);
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-border);
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pagination a {
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

.pagination a:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
}

.pagination span {
  color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   11c. Homepage — Magazine Layout
   -------------------------------------------------------------------------- */

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #ffffff;
  padding: var(--sp-8) 0;
  text-align: center;
}

.hero h1 {
  color: #ffffff;
  font-size: 1.75rem;
  margin-bottom: var(--sp-4);
  max-width: 700px;
  margin-inline: auto;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-lg);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

.cta-btn {
  display: inline-block;
  padding: var(--sp-3) var(--sp-6);
  background-color: #ffffff;
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: var(--text-base);
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
  min-width: 44px;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  color: var(--color-primary-dark);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.stat-label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--sp-1);
}

/* Homepage Sections */
.homepage-section {
  padding: var(--sp-8) 0;
}

.homepage-section h2 {
  margin-top: 0;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--color-primary-light);
}

.homepage-section--alt {
  background-color: var(--color-bg-alt);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}

.card {
  display: block;
  padding: var(--sp-5);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(26, 122, 109, 0.12);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.card-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-bottom: var(--sp-2);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Section "Ver todos" link */
.section-link {
  margin-top: var(--sp-5);
  margin-bottom: 0;
}

.section-link a {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
}

.section-link a:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}

/* City pills grid */
.city-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.city-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-5);
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  min-height: 44px;
}

.city-pill:hover {
  background-color: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* FAQ list */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.faq-item {
  display: block;
  padding: var(--sp-5);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.faq-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(26, 122, 109, 0.08);
  color: var(--color-text);
}

.faq-item h3 {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-top: 0;
  margin-bottom: var(--sp-2);
}

.faq-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. Footer — Multi-column dark footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #1a1a2e;
  color: #c8ccd4;
  margin-top: var(--sp-8);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* 3-column grid on desktop, stacked on mobile */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--sp-8) var(--container-pad) var(--sp-6);
}

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--sp-4);
  letter-spacing: 0.01em;
}

.footer-description {
  color: #a0a6b4;
  margin-bottom: 0;
}

/* Portfolio links column */
.portfolio-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.portfolio-links a {
  display: block;
  text-decoration: none;
  color: #c8ccd4;
  padding: var(--sp-3);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.portfolio-links a:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.portfolio-links strong {
  display: block;
  color: #ffffff;
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.portfolio-links span {
  font-size: var(--text-xs);
  color: #8b91a0;
}

/* Quick links column */
.footer-quick-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer-quick-links a {
  color: #c8ccd4;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-quick-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Footer columns */
.footer-col {
  min-width: 0; /* prevent grid blowout */
}

.footer-col--about .footer-description {
  color: #a0a6b4;
}

.footer-col--portfolio {
  /* inherits grid placement from .footer-grid */
}

.footer-col--links {
  /* inherits grid placement from .footer-grid */
}

/* Portfolio section wrapper in footer */
.footer-portfolio {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Copyright bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: var(--sp-4) var(--container-pad);
  color: #6b7180;
  font-size: var(--text-xs);
}

.footer-bottom p {
  margin-bottom: 0;
}

/* General footer link styles */
.site-footer a {
  color: #c8ccd4;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer a:focus-visible {
  outline-color: #ffffff;
}

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

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

/* --------------------------------------------------------------------------
   14. Tablet Breakpoint (768px+)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  :root {
    --container-pad: 2rem;
  }

  /* Larger headings on tablet+ */
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.35rem; }
  h4 { font-size: 1.125rem; }

  /* Content gets breathing room */
  .content,
  .article-body,
  article {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }

  .single-post {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }

  .section-list {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }

  /* Hero — larger on tablet */
  .hero {
    padding: var(--sp-10) 0;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  /* Card grid — 2 columns on tablet */
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  /* Footer — 3-column grid on tablet+ */
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: var(--sp-8);
    padding: var(--sp-10) var(--container-pad) var(--sp-8);
  }
}

/* --------------------------------------------------------------------------
   14b. Desktop Breakpoint (1024px+) — Nav goes horizontal
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  /* Header — horizontal layout */
  .site-header .container {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .site-logo {
    font-size: 1.35rem;
  }

  /* Hamburger hidden on desktop */
  .menu-toggle {
    display: none;
  }

  /* Navigation — always visible and horizontal on desktop */
  .site-nav {
    display: flex;
    width: auto;
  }

  .site-nav ul {
    flex-direction: row;
    gap: var(--sp-1);
    align-items: center;
  }

  .site-nav li {
    border-bottom: none;
  }

  .site-nav a {
    min-height: auto;
    padding: var(--sp-2) var(--sp-3);
  }

  /* Hero — even larger on desktop */
  .hero h1 {
    font-size: 2.75rem;
  }

  /* Card grid — 3 columns on desktop */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   14c. Search Page
   -------------------------------------------------------------------------- */
.search-page {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-8);
  max-width: var(--content-max);
  margin-inline: auto;
}

.search-box {
  margin-bottom: var(--sp-6);
}

.search-input {
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-lg);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 56px;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.search-input::placeholder {
  color: var(--color-text-light);
}

.search-no-results {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--sp-8) 0;
  font-size: var(--text-lg);
}

.search-result-list {
  list-style: none;
  padding: 0;
}

.search-result-item {
  border-bottom: 1px solid var(--color-border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item a {
  display: block;
  padding: var(--sp-5) var(--sp-2);
  text-decoration: none;
  color: var(--color-text);
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.search-result-item a:hover {
  background-color: var(--color-bg-alt);
}

.search-result-title {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: var(--sp-2);
}

.search-result-item a:hover .search-result-title {
  color: var(--color-accent);
}

.search-result-snippet {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

@media (min-width: 768px) {
  .search-page {
    padding-top: var(--sp-8);
  }

  .search-input {
    font-size: 1.25rem;
    min-height: 60px;
  }
}

/* --------------------------------------------------------------------------
   15. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .site-nav,
  .toc,
  #TableOfContents,
  .table-of-contents {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}
