/*
Theme Name: The Adria Times
Theme URI: https://example.com/adria-times
Author: Matija
Description: A minimal newspaper theme inspired by the classic look of The New York Times. Serif headlines, thin rules, black on white. Built for aggregated and original Balkan news.
Version: 1.3.3
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: adria-times
*/

:root {
  --at-black: #121212;
  --at-gray: #5a5a5a;
  --at-light-gray: #999;
  --at-rule: #e2e2e2;
  --at-rule-dark: #121212;
  --at-link: #326891;
  --at-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --at-body-serif: Georgia, "Times New Roman", serif;
  --at-sans: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--at-body-serif);
  color: var(--at-black);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--at-link); }

.at-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Masthead ---------- */

.at-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-family: var(--at-sans);
  font-size: 12px;
  color: var(--at-gray);
}

.at-topbar a { color: var(--at-gray); }
.at-topbar a:hover { color: var(--at-black); }

/* Search toggle + popup */

.at-search-toggle,
.at-nav-toggle,
.at-search-close,
.at-drawer-close {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--at-sans);
  font-size: 13px;
  color: var(--at-gray);
  padding: 6px 8px;
}

.at-search-toggle:hover, .at-nav-toggle:hover, .at-search-close:hover { color: var(--at-black); }

.at-search-toggle .at-search-label { margin-left: 6px; }

.at-nav-toggle { display: none; font-size: 18px; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.at-search-popup {
  border-top: 1px solid var(--at-rule);
  border-bottom: 1px solid var(--at-rule);
  padding: 22px 0;
}

.at-search-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.at-search-title {
  font-family: var(--at-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.at-search-form {
  display: flex;
  border-bottom: 2px solid var(--at-black);
}

.at-search-form input[type="search"] {
  flex: 1;
  border: 0;
  outline: none;
  font-family: var(--at-serif);
  font-size: 18px;
  padding: 8px 4px;
  background: transparent;
}

.at-search-form button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  color: var(--at-gray);
  padding: 0 10px;
}

.at-search-form button:hover { color: var(--at-black); }

.at-search-close {
  position: absolute;
  top: -10px;
  right: 0;
  font-size: 16px;
}

/* Social icons */

.at-social { display: flex; gap: 4px; }

.at-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: var(--at-gray);
}

.at-social a:hover { color: var(--at-black); }

.at-social svg { width: 14px; height: 14px; fill: currentColor; }
.at-footer .at-social svg { width: 16px; height: 16px; }

/* Mobile-only elements and drawer plumbing */
.at-mob { display: none; }
.at-nav-social { display: none; }
.at-drawer-close { display: none; }

.at-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}
.at-nav-backdrop[hidden] { display: none; }

body.at-noscroll { overflow: hidden; }

.at-masthead { text-align: center; padding: 26px 0 18px; }

.at-masthead .site-title {
  font-family: var(--at-serif);
  font-weight: 900;
  font-size: clamp(34px, 6vw, 60px);
  letter-spacing: 0.5px;
  line-height: 1;
}

.at-masthead .site-title a:hover { color: var(--at-black); }

.at-masthead .site-tagline {
  font-family: var(--at-sans);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--at-gray);
  margin-top: 8px;
}

/* ---------- Navigation ---------- */

.at-nav {
  border-top: 2px solid var(--at-rule-dark);
  border-bottom: 1px solid var(--at-rule-dark);
  position: relative;
}

.at-nav::after {
  content: "";
  display: block;
  border-bottom: 1px solid var(--at-rule-dark);
  margin-top: 2px;
}

.at-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.at-nav li a {
  display: block;
  padding: 10px 16px;
  font-family: var(--at-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.at-nav li a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Front page ---------- */

.at-main { padding: 30px 0 50px; }

.at-archive-title {
  font-family: var(--at-serif);
  font-size: 30px;
  font-weight: 700;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--at-rule-dark);
}

.at-archive-title span { color: var(--at-gray); font-style: italic; }

/* Lead story */

.at-lead {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--at-rule-dark);
  margin-bottom: 30px;
}

.at-lead-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

.at-lead-body { align-self: center; }

.at-lead-body h2 {
  font-family: var(--at-serif);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1.12;
  margin: 6px 0 14px;
}

.at-lead-body .at-excerpt { font-size: 17px; color: var(--at-gray); }

/* Meta */

.at-meta {
  font-family: var(--at-sans);
  font-size: 12px;
  color: var(--at-light-gray);
  margin-top: 12px;
}

/* Card grid */

.at-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 30px;
}

.at-card {
  padding: 22px 0;
  border-top: 1px solid var(--at-rule);
}

.at-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  margin-bottom: 14px;
}

.at-card h3 {
  font-family: var(--at-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin: 6px 0 8px;
}

.at-card .at-excerpt { font-size: 14.5px; color: var(--at-gray); }

/* Infinite scroll */

.at-infinite {
  text-align: center;
  padding: 28px 0;
  font-family: var(--at-sans);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--at-light-gray);
}

.at-infinite .at-loading { visibility: hidden; }
.at-infinite.is-loading .at-loading { visibility: visible; }

.at-pagination {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--at-rule-dark);
  font-family: var(--at-sans);
  font-size: 13px;
  text-align: center;
}

.at-pagination a { font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Single article ---------- */

.at-article { max-width: 720px; margin: 0 auto; }

.at-article-header { text-align: left; padding: 10px 0 4px; }

.at-article-header h1 {
  font-family: var(--at-serif);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  margin: 10px 0 16px;
}

.at-byline {
  font-family: var(--at-sans);
  font-size: 13px;
  color: var(--at-gray);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--at-rule);
  margin-bottom: 10px;
}

.at-byline strong { color: var(--at-black); }

.at-article .at-featured { margin: 0 0 8px; }

.at-article .at-featured figcaption,
.at-article .wp-caption-text {
  font-family: var(--at-sans);
  font-size: 12px;
  color: var(--at-light-gray);
  padding-top: 6px;
}

.at-content { font-size: 19px; line-height: 1.75; margin-top: 8px; }

.at-content p, .at-content ul, .at-content ol, .at-content blockquote,
.at-content h2, .at-content h3, .at-content figure { margin-bottom: 24px; }

.at-content h2, .at-content h3 { font-family: var(--at-serif); line-height: 1.25; }

.at-content a { color: var(--at-link); text-decoration: underline; text-underline-offset: 3px; }

.at-content blockquote {
  border-left: 3px solid var(--at-black);
  padding-left: 20px;
  font-style: italic;
  color: var(--at-gray);
}

/* Source attribution box (added by the aggregator plugin) */

.adria-source-box {
  font-family: var(--at-sans);
  font-size: 14px;
  border-top: 2px solid var(--at-black);
  border-bottom: 1px solid var(--at-rule);
  padding: 14px 0;
  margin-top: 30px;
  color: var(--at-gray);
}

.adria-source-box a { color: var(--at-link); font-weight: 600; }

/* ---------- Footer ---------- */

.at-footer {
  border-top: 2px solid var(--at-rule-dark);
  margin-top: 20px;
  padding: 26px 0 40px;
  font-family: var(--at-sans);
  font-size: 12px;
  color: var(--at-gray);
  text-align: center;
}

.at-footer .at-footer-title {
  font-family: var(--at-serif);
  font-weight: 900;
  font-size: 22px;
  color: var(--at-black);
  margin-bottom: 8px;
}

.at-footer .at-social { justify-content: center; margin-top: 6px; }
.at-footer .at-social a { font-size: 16px; width: 32px; height: 32px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .at-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .at-grid { grid-template-columns: 1fr; }
  .at-content { font-size: 18px; }

  /* On mobile the newest post is not highlighted: it looks like every other story */
  .at-lead {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 22px 0;
    border-bottom: 1px solid var(--at-rule);
    margin-bottom: 0;
  }
  .at-lead-media img { margin-bottom: 14px; }
  .at-lead-body h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 6px 0 8px;
  }
  .at-lead-body .at-excerpt { font-size: 14.5px; }

  /* Desktop top bar disappears; burger, title and search share one row */
  .at-topbar { display: none; }
  .at-mob { display: block; }

  .at-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 15px 0 13px;
    border-bottom: 4px double var(--at-rule-dark);
  }
  .at-masthead .site-title { font-size: clamp(25px, 7.5vw, 35px); flex: 1; text-align: center; }
  .at-masthead .at-nav-toggle,
  .at-masthead .at-search-toggle { font-size: 19px; padding: 8px; }

  /* Tighter gap between the header and the first article */
  .at-main { padding-top: 12px; }
  .at-lead { padding-top: 10px; }

  /* Primary menu becomes a left slide-in drawer */
  .at-nav,
  .at-nav::after { border: 0; }
  .at-nav::after { display: none; }
  .at-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: #fff;
    z-index: 1000;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s ease;
    padding: 56px 22px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .at-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  .at-nav ul { flex-direction: column; }
  .at-nav li a {
    padding: 13px 2px;
    border-bottom: 1px solid var(--at-rule);
    font-size: 14px;
  }
  .at-drawer-close {
    display: block;
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
  }
  .at-drawer-close:focus:not(:focus-visible) { outline: 0; }
  .at-nav-empty { display: none; }

  /* Social icons at the bottom of the drawer */
  .at-nav .at-nav-social { display: block; margin-top: auto; padding-top: 18px; }
  .at-nav .at-nav-social .at-social { display: flex; justify-content: center; }
  .at-nav-social .at-social a { font-size: 17px; width: 38px; height: 38px; }
}
