/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f6f6ef;
}

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

a {
    color: #c2410c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #111827;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

strong {
    font-weight: 600;
}

/* ============================================
   Layout
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 3rem 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    background-color: #c2410c;
    color: #fff;
    border: 2px solid #c2410c;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #9a3412;
    border-color: #9a3412;
    text-decoration: none;
}

/* ============================================
   Header
   ============================================ */

.site-header {
    background-color: #c2410c;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-title {
    flex: 1;
}

.logo-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.logo-text:hover {
    text-decoration: none;
}

.logo-dot {
    color: #fff;
}

.site-nav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.site-nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   Latest Articles Section
   ============================================ */

.latest-articles {
    background-color: transparent;
    padding: 1.5rem 0 2rem;
}

.latest-articles h2 {
    font-size: 0.75rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.articles-grid {
    counter-reset: articles;
    max-width: 760px;
}

.article-card {
    padding: 0.375rem 0;
    border-bottom: 1px solid #ddd;
}

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

.articles-grid .article-card {
    counter-increment: articles;
    padding-left: 1.75rem;
    position: relative;
}

.articles-grid .article-card::before {
    content: counter(articles) ".";
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
}

.article-card h3 {
    font-size: 1rem;
    margin-bottom: 0.125rem;
    font-weight: 600;
}

.article-card h3 a {
    color: #111827;
    text-decoration: none;
}

.article-card h3 a:hover {
    color: #c2410c;
    text-decoration: none;
}

.article-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.125rem;
}

.article-card h2 a {
    color: #111827;
    text-decoration: none;
}

.article-card h2 a:hover {
    color: #c2410c;
    text-decoration: none;
}

.article-card p {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-bottom: 0.125rem;
    line-height: 1.4;
}

.article-card time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.section-cta {
    margin-top: 0.75rem;
    max-width: 760px;
    padding-left: 1.75rem;
    font-size: 0.875rem;
}

/* ============================================
   Blog Listing
   ============================================ */

.blog-listing {
    background-color: #fff;
    padding: 3rem 0;
}

.blog-listing h1 {
    margin-bottom: 2rem;
}

.articles-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* ============================================
   Blog Post
   ============================================ */

.blog-post {
    background-color: #fff;
    padding: 3rem 0;
}

.blog-post-container {
    max-width: 760px;
}

.blog-post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.blog-post-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.blog-post-meta {
    font-size: 0.9375rem;
    color: #6b7280;
}

.blog-post-meta time {
    display: inline;
}

.blog-post-author {
    margin-left: 0.5rem;
}

.blog-post-author::before {
    content: "\00b7";
    margin-right: 0.5rem;
}

.blog-post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.blog-post-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-post-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.blog-post-content p {
    margin-bottom: 1.25rem;
}

.blog-post-content a {
    text-decoration: underline;
}

.blog-post-content a:hover {
    color: #9a3412;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.blog-post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.blog-post-content blockquote {
    border-left: 3px solid #c2410c;
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.blog-post-content th,
.blog-post-content td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.blog-post-content th {
    font-weight: 700;
    border-bottom: 2px solid #111827;
    background-color: #f8f9fa;
}

.blog-post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.blog-post-cta {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.blog-post-cta h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.blog-post-cta p {
    margin-bottom: 1rem;
    color: #4b5563;
}

/* ============================================
   Privacy / Page Layout
   ============================================ */

.page-content {
    background-color: #fff;
    padding: 3rem 0;
}

.page-content .container {
    max-width: 760px;
}

.page-content h1 {
    margin-bottom: 0.75rem;
}

.page-content h2 {
    font-size: 1.375rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.page-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.page-content ul {
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
    margin-top: -0.25rem;
}

.page-content li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
    padding-left: 0.25rem;
}

.page-content a {
    text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background-color: #111827;
    color: #d1d5db;
    padding: 3rem 0 1.5rem;
}

.site-footer a {
    color: #d1d5db;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #fff;
}

.footer-col p {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-col p:last-child {
    margin-bottom: 0;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-legal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.footer-legal a {
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-copyright p {
    margin: 0;
}

/* ============================================
   Tablet Styles (768px+)
   ============================================ */

@media (min-width: 768px) {
    section {
        padding: 4rem 0;
    }

    .latest-articles {
        padding: 2rem 0 3rem;
    }

    .articles-list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer - 3 columns */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 3rem;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer-legal {
        flex-direction: row;
        gap: 1.5rem;
    }

    /* Blog post */
    .blog-post-header h1 {
        font-size: 2.75rem;
    }
}

/* ============================================
   Desktop Styles (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    section {
        padding: 5rem 0;
    }

    .latest-articles {
        padding: 2rem 0 3rem;
    }

    h1 {
        font-size: 3rem;
    }
}

/* ============================================
   Dormitory Directory
   ============================================ */

.directory-listing {
    background-color: #fff;
    padding: 3rem 0;
}

.directory-intro {
    color: #4b5563;
    margin-bottom: 1rem;
    max-width: 640px;
}

.directory-notice {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.city-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 760px;
}

.city-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.city-card:hover {
    background-color: #f0f0e6;
    text-decoration: none;
}

.city-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0;
    color: #111827;
}

.city-count {
    font-size: 0.8125rem;
    color: #6b7280;
    white-space: nowrap;
}

/* City Index */

.city-listing {
    background-color: #fff;
    padding: 3rem 0;
}

.city-listing-breadcrumb,
.dormitory-breadcrumb {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.city-listing-breadcrumb a,
.dormitory-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.city-listing-breadcrumb a:hover,
.dormitory-breadcrumb a:hover {
    color: #c2410c;
}

.city-listing-breadcrumb span,
.dormitory-breadcrumb span {
    margin: 0 0.375rem;
}

.dorm-list {
    max-width: 760px;
}

.dorm-card {
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.dorm-card:last-child {
    border-bottom: none;
}

.dorm-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.dorm-card h2 a {
    color: #111827;
    text-decoration: none;
}

.dorm-card h2 a:hover {
    color: #c2410c;
}

.dorm-card-meta {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

.dorm-card-meta span + span::before {
    content: "\00b7";
    margin: 0 0.375rem;
}

/* Individual Dormitory Page */

.dormitory-page {
    background-color: #fff;
    padding: 3rem 0;
}

.dormitory-container {
    max-width: 900px;
}

.dormitory-top {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dormitory-top-info {
    flex: 1;
    min-width: 0;
}

.dormitory-map {
    width: 100%;
    height: 260px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    z-index: 0;
}

.dormitory-header {
    margin-bottom: 2rem;
}

.dormitory-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.dormitory-meta {
    font-size: 0.9375rem;
    color: #6b7280;
}

.dormitory-meta span + span::before {
    content: "\00b7";
    margin: 0 0.5rem;
}

.dormitory-details {
    margin-bottom: 2rem;
}

.dormitory-info-table {
    width: 100%;
    max-width: 480px;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.dormitory-info-table th {
    text-align: left;
    font-weight: 600;
    padding: 0.5rem 1rem 0.5rem 0;
    color: #6b7280;
    white-space: nowrap;
    width: 120px;
    vertical-align: top;
    border-bottom: 1px solid #f3f4f6;
}

.dormitory-info-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.dormitory-description {
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.dormitory-description p {
    margin-bottom: 1.25rem;
}

.dormitory-description a {
    text-decoration: underline;
}

.dormitory-description a:hover {
    color: #9a3412;
}

.dormitory-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.dormitory-cta {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.dormitory-cta h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.dormitory-cta p {
    margin-bottom: 1rem;
    color: #4b5563;
}

@media (min-width: 768px) {
    .city-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dormitory-header h1 {
        font-size: 2.75rem;
    }

    .dormitory-top {
        flex-direction: row;
        align-items: flex-start;
    }

    .dormitory-map {
        width: 320px;
        min-width: 320px;
        height: 280px;
    }
}

@media (min-width: 1024px) {
    .city-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
