@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Merriweather:wght@400;700;900&display=swap');

/* =========================================================
   E-THESSALIA | COMPLETE RESPONSIVE STYLESHEET
   ========================================================= */

:root {
    --navy: #102a43;
    --blue: #174a72;
    --red: #c82032;
    --text: #202b36;
    --muted: #718096;
    --line: #e2e8f0;
    --bg: #f5f7fa;
    --white: #ffffff;
    --shadow: 0 5px 20px rgba(16,42,67,.07);
    --shadow-hover: 0 12px 28px rgba(16,42,67,.13);
    --container: 1200px;
    --main-column: 800px;
    --sidebar-column: 350px;
    --layout-gap: 50px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   HEADER
   ========================================================= */

.topbar {
    background: var(--navy);
    color: #dbe7f1;
    font-size: 12px;
    padding: 9px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.masthead {
    background: var(--white);
    min-height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-bottom: 1px solid var(--line);
    text-align: center;
    padding: 15px;
}

.logo {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 900;
    font-size: clamp(38px, 6vw, 62px);
    letter-spacing: -3px;
    line-height: 1.2;
    color: var(--navy);
}

.logo span {
    color: var(--red);
}

.masthead-subtitle {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 7px;
}

.main-nav {
    background: var(--white);
    border-bottom: 3px solid var(--red);
    box-shadow: 0 3px 10px rgba(16,42,67,.06);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-inner a {
    display: block;
    padding: 16px 13px;
    font-size: 11px;
    font-weight: 800;
    color: var(--navy);
    white-space: nowrap;
    transition: background .2s, color .2s;
}

.nav-inner a:hover,
.nav-inner a:focus-visible {
    background: var(--navy);
    color: var(--white);
}

/* =========================================================
   BREAKING NEWS
   ========================================================= */

.breaking {
    margin-top: 22px;
    margin-bottom: 28px;
    display: flex;
    align-items: stretch;
    min-height: 44px;
    background: var(--white);
    border: 1px solid var(--line);
    overflow: hidden;
}

.breaking-label {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: var(--white);
    padding: 0 17px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.breaking-track {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0 17px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.breaking-item {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
}

.breaking-item:hover {
    color: var(--red);
}

/* =========================================================
   MAIN HOMEPAGE LAYOUT
   ========================================================= */

.homepage-layout {
    display: grid;
    grid-template-columns: minmax(0, 800px) minmax(0, 350px);
    gap: 50px;
    align-items: start;
    width: min(var(--container), calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
}

.homepage-main {
    min-width: 0;
    width: 100%;
}

.site-sidebar {
    display: block;
    min-width: 0;
    width: 100%;
    padding-top: 34px;
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 2px solid var(--navy);
    margin: 34px 0 19px;
    padding-bottom: 10px;
}

.section-heading h2 {
    font-size: 16px;
    font-weight: 900;
    margin: 0;
    color: var(--navy);
    letter-spacing: .3px;
}

.section-heading > span {
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

/* =========================================================
   LEAD STORIES
   ========================================================= */

.lead-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.lead-story {
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .25s, box-shadow .25s;
}

.lead-story:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.lead-image-link {
    display: block;
}

.lead-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    height: auto;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #173b59, #547b96);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    isolation: isolate;
}

.lead-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(5,20,34,0) 15%,
        rgba(5,20,34,.18) 45%,
        rgba(5,20,34,.88) 100%
    );
    z-index: -1;
    pointer-events: none;
}

.lead-image::after {
    content: 'e-Θ';
    color: rgba(255,255,255,.10);
    font-family: Georgia, serif;
    font-size: clamp(65px, 8vw, 110px);
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 15px;
    pointer-events: none;
    z-index: -1;
}

.image-caption {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-size: 9px;
    font-weight: 900;
    padding: 6px 10px;
    margin-bottom: 9px;
    position: relative;
    z-index: 2;
}

.lead-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 18px 19px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(5,20,34,.28) 20%,
        rgba(5,20,34,.91) 100%
    );
    color: var(--white);
}

.lead-overlay .image-caption {
    margin-bottom: 8px;
}

.lead-overlay .category {
    display: block;
    color: #ffb6bd;
    margin: 0 0 6px;
}

.lead-overlay h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(16px, 1.65vw, 21px);
    line-height: 1.4;
    font-weight: 900;
    color: var(--white);
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

.lead-overlay .meta {
    color: rgba(255,255,255,.8);
}

.lead-content {
    padding: 15px 18px 18px;
}

.lead-content h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.4;
    margin: 0 0 11px;
    color: var(--navy);
}

.lead-content p {
    font-size: 13px;
    line-height: 1.65;
    color: #526273;
    margin: 0 0 13px;
}

/* =========================================================
   GENERAL CATEGORY LABELS AND METADATA
   ========================================================= */

.category {
    display: inline-block;
    color: var(--red);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.meta {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

/* =========================================================
   CATEGORY SECTIONS
   ========================================================= */

.news-section {
    margin-top: 40px;
    min-width: 0;
}

.category-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 15px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.category-lead {
    min-width: 0;
    overflow: hidden;
}

.category-lead > a {
    display: block;
    overflow: hidden;
}

.category-lead img,
.card-image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    background: #e6edf2;
    margin-bottom: 13px;
}

.category-lead img {
    transition: transform .35s;
}

.category-lead > a:hover img {
    transform: scale(1.025);
}

.card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #173b59, #7895a9);
    color: rgba(255,255,255,.85);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 25px;
    font-weight: 900;
}

.category-lead h3 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 17px;
    line-height: 1.5;
    color: var(--navy);
    margin: 0 0 10px;
    transition: color .2s;
}

.category-lead a:hover h3,
.category-small-story a:hover h3 {
    color: var(--red);
}

.category-side-stories {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.category-small-story {
    min-width: 0;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.category-small-story:first-child {
    padding-top: 0;
}

.category-small-story:last-child {
    border-bottom: 0;
}

.category-small-story a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.category-small-story img {
    display: block;
    width: 92px;
    height: 69px;
    flex: 0 0 92px;
    object-fit: cover;
    object-position: center;
    background: #e6edf2;
}

.category-small-story h3 {
    min-width: 0;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--navy);
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    transition: color .2s;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.site-sidebar section {
    display: block;
    width: 100%;
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 19px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    color: var(--navy);
    font-size: 13px;
    font-weight: 900;
    margin: 0 0 14px;
    padding-bottom: 11px;
    border-bottom: 2px solid var(--red);
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.social-button {
    display: block;
    min-width: 0;
    padding: 11px 7px;
    text-align: center;
    color: var(--white);
    font-size: 11px;
    font-weight: 800;
    border-radius: 3px;
    transition: opacity .2s, transform .2s;
}

.social-button:hover {
    opacity: .88;
    transform: translateY(-2px);
}

.facebook { background: #1877f2; }
.instagram { background: #a43c86; }
.youtube { background: #d71920; }
.viber { background: #665cac; }

.sidebar-divider {
    height: 1px;
    background: var(--line);
    margin: -5px 0 8px;
}

.sidebar-news-item {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.sidebar-news-item:last-child {
    border-bottom: 0;
}

.sidebar-news-date {
    display: block;
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
}

.sidebar-news-item h3 {
    color: var(--navy);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 12px;
    line-height: 1.55;
    margin: 5px 0 0;
    transition: color .2s;
}

.sidebar-news-item a:hover h3 {
    color: var(--red);
}

.sidebar-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

/* Sidebar advertisement and HTML blocks */
.sidebar-ad-placeholder,
.sidebar-html-placeholder {
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    border: 1px dashed #bdc9d4;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
}

.site-sidebar iframe,
.site-sidebar video,
.site-sidebar embed,
.site-sidebar object {
    max-width: 100%;
}

.site-sidebar iframe {
    width: 100%;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    background: var(--navy);
    color: #dbe7f1;
    padding: 38px 0 25px;
    margin-top: 55px;
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    margin-bottom: 20px;
}

.footer-logo {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 900;
    font-size: 29px;
    color: var(--white);
}

.footer-brand p {
    font-size: 12px;
    color: #b8c9d8;
    margin: 8px 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.footer-links a {
    font-size: 11px;
    color: #dbe7f1;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.footer-copyright {
    border-top: 1px solid rgba(255,255,255,.13);
    padding-top: 19px;
    margin: 0;
    font-size: 11px;
    color: #b8c9d8;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 43px;
    height: 43px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: var(--white);
    font-size: 23px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .25s;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================================
   EMPTY STATES
   ========================================================= */

.placeholder {
    background: var(--white);
    border: 1px solid var(--line);
    padding: 22px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================================
   TABLET: 801px - 1100px
   ========================================================= */

@media (min-width: 801px) and (max-width: 1100px) {
    .homepage-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 25px;
    }

    .nav-inner a {
        padding-left: 10px;
        padding-right: 10px;
    }

    .lead-image {
        aspect-ratio: 16 / 9;
    }

    .category-feature {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-side-stories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }

    .category-small-story {
        padding: 11px 0;
    }
}

/* =========================================================
   MOBILE AND SMALL TABLET: 0px - 800px
   ========================================================= */

@media (max-width: 800px) {
    .container,
    .homepage-layout {
        width: calc(100% - 30px);
    }

    .homepage-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .homepage-main {
        width: 100%;
        order: 1;
    }

    .site-sidebar {
        width: 100%;
        order: 2;
        padding-top: 22px;
    }

    .site-sidebar section {
        margin-bottom: 16px;
    }

    .lead-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lead-image {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .lead-overlay {
        padding: 12px;
    }

    .lead-overlay h1 {
        font-size: 16px;
    }

    .nav-inner {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }

    .nav-inner a {
        white-space: nowrap;
    }

    .category-feature {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-lead img,
    .category-lead .card-image-placeholder {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .category-side-stories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 15px;
    }

    .category-small-story:nth-child(odd) {
        padding-right: 7px;
    }

    .category-small-story:nth-child(even) {
        padding-left: 7px;
    }
}

/* =========================================================
   SMALL MOBILE: 0px - 520px
   ========================================================= */

@media (max-width: 520px) {
    .container,
    .homepage-layout {
        width: calc(100% - 24px);
    }

    .topbar-inner {
        font-size: 10px;
        gap: 8px;
    }

    .masthead {
        min-height: 105px;
    }

    .logo {
        font-size: 40px;
        letter-spacing: -2px;
    }

    .masthead-subtitle {
        font-size: 9px;
        letter-spacing: 2px;
    }

    .breaking {
        flex-direction: column;
        margin-top: 15px;
        margin-bottom: 20px;
    }

    .breaking-label {
        min-height: 32px;
    }

    .breaking-track {
        min-height: 40px;
        padding: 0 12px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        margin-top: 27px;
    }

    .section-heading > span {
        text-align: left;
    }

    .lead-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .lead-image {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .lead-overlay {
        padding: 14px;
    }

    .lead-overlay h1 {
        font-size: 18px;
    }

    .lead-content {
        padding: 13px 15px 16px;
    }

    .category-feature {
        padding: 11px;
        gap: 14px;
    }

    .category-lead img,
    .category-lead .card-image-placeholder {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .category-lead h3 {
        font-size: 15px;
    }

    .category-side-stories {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-small-story:nth-child(n) {
        padding: 11px 0;
    }

    .category-small-story a {
        gap: 11px;
    }

    .category-small-story img {
        width: 92px;
        height: 69px;
        flex-basis: 92px;
    }

    .site-sidebar {
        padding-top: 20px;
    }

    .site-sidebar section {
        padding: 15px;
    }

    .footer-links {
        gap: 12px;
    }

    .back-to-top {
        right: 14px;
        bottom: 14px;
    }
}

/* =========================================================
   ACCESSIBILITY AND SAFETY
   ========================================================= */

a:focus-visible,
button:focus-visible {
    outline: 3px solid #f2b705;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
