/*
Theme Name: Tabloid Parent
Theme URI: https://iltabloid.it
Author: EO Factory Lab
Author URI: https://eofactory.it
Description: Tema parent per i verticali del network Il Tabloid
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: tabloid-parent
Tags: news, magazine, editorial
*/

:root {
  --color-accent: #1a7abf;
  --color-topbar: #f5a623;
  --color-badge: #f5a623;
  --color-badge-text: #ffffff;
  --color-bg: #ffffff;
  --color-footer-bg: #1a7abf;
  --color-footer-text: #ffffff;
  --color-text: #1a1a1a;
  --color-meta: #888888;
  --color-border: #e5e5e5;
  --font-primary: 'Open Sans', sans-serif;
  --container-width: 1200px;
  --grid-gap: 20px;
  --border-radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-primary); font-size: 15px; color: var(--color-text); background: var(--color-bg); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.tbl-container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }

.tbl-topbar { background: var(--color-topbar); padding: 6px 0; }
.tbl-topbar__inner { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.tbl-topbar__inner a { color: #ffffff; font-size: 14px; display: flex; align-items: center; }
.tbl-topbar__inner a:hover { opacity: 0.8; text-decoration: none; }

.tbl-header { background: var(--color-accent); padding: 14px 0; }
.tbl-header__inner { display: flex; justify-content: space-between; align-items: center; }
.tbl-header__logo img { height: 50px; width: auto; }
.tbl-header__logo a:hover { opacity: 0.9; text-decoration: none; }

.tbl-menu-toggle { background: none; border: none; cursor: pointer; padding: 4px; display: flex; flex-direction: column; gap: 5px; }
.tbl-menu-toggle span { display: block; width: 28px; height: 3px; background: var(--color-topbar); border-radius: 2px; transition: all 0.3s; }

.tbl-nav { display: none; background: var(--color-accent); border-top: 1px solid rgba(255,255,255,0.2); }
.tbl-nav.is-open { display: block; }
.tbl-nav ul { list-style: none; }
.tbl-nav ul li a { display: block; padding: 12px 20px; color: #ffffff; font-size: 14px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); text-transform: uppercase; letter-spacing: 0.5px; }
.tbl-nav ul li a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

.tbl-page-title { text-align: center; padding: 30px 0 20px; }
.tbl-page-title h1 { font-size: 22px; font-weight: 700; color: var(--color-accent); text-transform: uppercase; letter-spacing: 1px; }

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

.tbl-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--border-radius); overflow: hidden; transition: box-shadow 0.2s; }
.tbl-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.tbl-card__thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.tbl-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.tbl-card:hover .tbl-card__thumb img { transform: scale(1.03); }
.tbl-card__badge { position: absolute; top: 10px; right: 10px; background: var(--color-badge); color: var(--color-badge-text); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 2px; }
.tbl-card__body { padding: 14px; }
.tbl-card__title { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--color-text); margin-bottom: 10px; }
.tbl-card__title a { color: inherit; }
.tbl-card__title a:hover { color: var(--color-accent); text-decoration: none; }
.tbl-card__meta { font-size: 12px; color: var(--color-meta); display: flex; align-items: center; gap: 8px; }
.tbl-card__meta .sep::before { content: '•'; }

.tbl-loadmore { text-align: center; padding: 10px 0 40px; }
.tbl-loadmore__btn { background: var(--color-accent); color: #fff; border: none; padding: 10px 30px; font-size: 14px; font-weight: 600; border-radius: var(--border-radius); cursor: pointer; transition: opacity 0.2s; }
.tbl-loadmore__btn:hover { opacity: 0.85; }

.tbl-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 30px 0; align-items: start; }
.tbl-main { min-width: 0; }
.tbl-sidebar { min-width: 0; }

.tbl-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--color-border); }
.tbl-row:first-child { border-top: 1px solid var(--color-border); }
.tbl-row__thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: var(--border-radius); }
.tbl-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl-row__cat { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--color-accent); margin-bottom: 6px; letter-spacing: 0.5px; }
.tbl-row__title { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.tbl-row__title a { color: var(--color-text); }
.tbl-row__title a:hover { color: var(--color-accent); text-decoration: none; }
.tbl-row__excerpt { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 8px; }
.tbl-row__meta { font-size: 12px; color: var(--color-meta); }

.tbl-single__cat { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--color-accent); margin-bottom: 10px; letter-spacing: 0.5px; }
.tbl-single__title { font-size: 26px; font-weight: 800; line-height: 1.3; color: var(--color-text); margin-bottom: 12px; }
.tbl-single__meta { font-size: 13px; color: var(--color-meta); display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.tbl-single__thumb { margin-bottom: 24px; border-radius: var(--border-radius); overflow: hidden; }
.tbl-single__thumb img { width: 100%; height: auto; }

.tbl-share { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tbl-share__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--border-radius); font-size: 12px; font-weight: 700; color: #fff; text-decoration: none; transition: opacity 0.2s; }
.tbl-share__btn:hover { opacity: 0.85; text-decoration: none; color: #fff; }
.tbl-share__btn--fb { background: #1877f2; }
.tbl-share__btn--tw { background: #000000; }
.tbl-share__btn--li { background: #0a66c2; }
.tbl-share__btn--wa { background: #25d366; }
.tbl-share__btn--pi { background: #e60023; }

.tbl-single__content { font-size: 16px; line-height: 1.8; color: var(--color-text); }
.tbl-single__content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; }
.tbl-single__content h3 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
.tbl-single__content p { margin-bottom: 18px; }
.tbl-single__content ul, .tbl-single__content ol { margin: 0 0 18px 24px; }
.tbl-single__content li { margin-bottom: 6px; }
.tbl-single__content blockquote { border-left: 4px solid var(--color-accent); padding: 12px 20px; margin: 24px 0; background: #f9f9f9; font-style: italic; color: #555; }
.tbl-single__content img { border-radius: var(--border-radius); margin: 20px 0; }

.tbl-tags { margin: 24px 0; }
.tbl-tags span { font-size: 13px; font-weight: 700; margin-right: 8px; }
.tbl-tags a { display: inline-block; padding: 4px 10px; background: #f0f0f0; border-radius: 20px; font-size: 12px; color: var(--color-text); margin: 3px 3px 3px 0; }
.tbl-tags a:hover { background: var(--color-accent); color: #fff; text-decoration: none; }

.tbl-author { display: flex; align-items: center; gap: 16px; padding: 20px; background: #f7f7f7; border-radius: var(--border-radius); margin: 30px 0; }
.tbl-author__avatar img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.tbl-author__name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.tbl-author__link { font-size: 13px; color: var(--color-accent); }

.tbl-related { margin-top: 30px; }
.tbl-related__title { font-size: 18px; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid var(--color-accent); margin-bottom: 20px; }
.tbl-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tbl-related__item__thumb { aspect-ratio: 16/10; overflow: hidden; border-radius: var(--border-radius); margin-bottom: 8px; }
.tbl-related__item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl-related__item__cat { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--color-accent); margin-bottom: 4px; }
.tbl-related__item__title { font-size: 13px; font-weight: 700; line-height: 1.4; }
.tbl-related__item__title a { color: var(--color-text); }
.tbl-related__item__title a:hover { color: var(--color-accent); text-decoration: none; }
.tbl-related__item__date { font-size: 11px; color: var(--color-meta); margin-top: 4px; }

.tbl-widget { margin-bottom: 28px; }
.tbl-widget__title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: var(--color-accent); color: #fff; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--border-radius) var(--border-radius) 0 0; }
.tbl-widget__post { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.tbl-widget__post:last-child { border-bottom: none; }
.tbl-widget__post__thumb { aspect-ratio: 1; overflow: hidden; border-radius: 2px; }
.tbl-widget__post__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl-widget__post__title { font-size: 12px; font-weight: 700; line-height: 1.4; }
.tbl-widget__post__title a { color: var(--color-text); }
.tbl-widget__post__title a:hover { color: var(--color-accent); text-decoration: none; }
.tbl-widget__post__date { font-size: 11px; color: var(--color-meta); margin-top: 4px; }

.tbl-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding: 40px 0 0; margin-top: 40px; }
.tbl-footer__grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.tbl-footer__col-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; color: var(--color-footer-text); text-align: center; }
.tbl-footer__nav { list-style: none; text-align: center; }
.tbl-footer__nav li { margin-bottom: 6px; }
.tbl-footer__nav a { color: rgba(255,255,255,0.85); font-size: 13px; }
.tbl-footer__nav a:hover { color: #fff; text-decoration: none; }
.tbl-footer__logo { display: block; margin: 0 auto 12px; max-height: 50px; width: auto; }
.tbl-footer__info { font-size: 12px; line-height: 1.8; color: rgba(255,255,255,0.85); text-align: center; }

.tbl-newsletter { display: flex; gap: 8px; margin-top: 10px; }
.tbl-newsletter input[type="email"] { flex: 1; padding: 8px 12px; border: none; border-radius: var(--border-radius); font-size: 13px; }
.tbl-newsletter button { background: var(--color-topbar); color: #fff; border: none; padding: 8px 18px; font-size: 13px; font-weight: 700; border-radius: var(--border-radius); cursor: pointer; text-transform: uppercase; }
.tbl-newsletter button:hover { opacity: 0.9; }

.tbl-footer__social { list-style: none; margin-top: 14px; }
.tbl-footer__social li { margin-bottom: 6px; }
.tbl-footer__social a { color: rgba(255,255,255,0.85); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tbl-footer__social a:hover { color: #fff; text-decoration: none; }

.tbl-footer__bottom { border-top: 1px solid rgba(255,255,255,0.2); padding: 14px 0; margin-top: 10px; }
.tbl-footer__bottom__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tbl-footer__bottom__links { display: flex; gap: 20px; }
.tbl-footer__bottom__links a { color: rgba(255,255,255,0.85); font-size: 12px; }
.tbl-footer__bottom__links a:hover { color: #fff; text-decoration: none; }
.tbl-footer__bottom__copy { font-size: 12px; color: rgba(255,255,255,0.7); }

@media (max-width: 900px) {
  .tbl-layout { grid-template-columns: 1fr; }
  .tbl-sidebar { display: none; }
  .tbl-grid { grid-template-columns: repeat(2, 1fr); }
  .tbl-related__grid { grid-template-columns: repeat(2, 1fr); }
  .tbl-footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .tbl-grid { grid-template-columns: 1fr; }
  .tbl-row { grid-template-columns: 1fr; }
  .tbl-row__thumb { aspect-ratio: 16/9; }
  .tbl-single__title { font-size: 20px; }
  .tbl-related__grid { grid-template-columns: 1fr; }
  .tbl-footer__bottom__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   HERO BLOCK HOMEPAGE
   ============================================================ */
.tbl-hero {
    display: grid;
    grid-template-columns: 1fr 1fr 300px;
    grid-template-rows: auto;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 10px;
}
.tbl-hero__main {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.tbl-hero__title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    margin: 8px 0 10px;
}
.tbl-hero__title a { color: var(--color-text); }
.tbl-hero__title a:hover { color: var(--color-accent); text-decoration: none; }
.tbl-hero__meta { font-size: 12px; color: var(--color-meta); margin-bottom: 10px; }
.tbl-hero__excerpt { font-size: 14px; color: #555; line-height: 1.6; }
.tbl-hero__thumb {
    grid-column: 2;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: var(--border-radius);
}
.tbl-hero__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tbl-hero__ad {
    grid-column: 3;
}

.tbl-grid--border {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 10px;
}

.tbl-banner-full {
    margin: 10px 0;
    text-align: center;
}

.tbl-ad-placeholder {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    border-radius: var(--border-radius);
}

.tbl-widget__post--large { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.tbl-widget__post--large:last-child { border-bottom: none; }
.tbl-widget__post__thumb--large { aspect-ratio: 16/10; overflow: hidden; border-radius: var(--border-radius); margin-bottom: 6px; }
.tbl-widget__post__thumb--large img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
    .tbl-hero { grid-template-columns: 1fr; }
    .tbl-hero__thumb { grid-column: 1; }
    .tbl-hero__ad { grid-column: 1; }
}
