/*
Theme Name: Flavor Starter
Theme URI: https://example.com/flavor-starter
Author: Starter Themes
Author URI: https://example.com
Description: A clean WordPress theme with ICA-inspired flat, institutional design. Centered logo, menu bar, content area for shortcodes. Customizer compatible.
Version: 1.4.2
Tested up to: 6.7
Requires at least: 5.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor-starter
Tags: one-column, custom-logo, custom-menu, editor-style, translation-ready
*/

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5ef;
}

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

#page {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    min-height: 100vh;
}

/* === HEADER === */
.site-header {
    text-align: center;
    padding: 24px 20px 0;
    background: #fff;
}

.site-logo { display: inline-block; margin-bottom: 12px; }
.site-logo img { max-height: 70px; width: auto; margin: 0 auto; }

.site-title { font-size: 1.6rem; font-weight: 700; color: #333; }
.site-title a { text-decoration: none; color: inherit; }

.site-description { font-size: 0.9rem; margin-bottom: 12px; color: #5a6a72; }

/* === NAVIGATION — ICA-style horizontal bar === */
.main-navigation {
    background: #2F7251;
}
.main-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.main-navigation a {
    display: block;
    padding: 12px 22px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.15s;
}
.main-navigation a:hover {
    background: rgba(255,255,255,0.15);
}

.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    flex-direction: column;
    z-index: 1000;
    background: #2F7251;
    border-top: 2px solid #1E5038;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.main-navigation ul ul a {
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.main-navigation li { position: relative; }
.main-navigation li:hover > ul { display: flex; }

.menu-toggle {
    display: none;
    border: 1px solid #d5d5c8;
    background: none;
    padding: 8px 18px;
    cursor: pointer;
    margin: 8px auto;
    font-family: inherit;
    font-weight: 600;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-navigation ul { display: none; flex-direction: column; align-items: center; }
    .main-navigation.toggled ul { display: flex; }
    .main-navigation ul ul { position: static; box-shadow: none; }
}

/* === CONTENT === */
.site-content {
    width: 100%;
    margin: 0;
    padding: 0 0 30px 0;
}

.site-main {
    margin: 0;
    padding: 0;
}

.entry-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; color: #333; }
.entry-title a { text-decoration: none; color: inherit; }
.page .entry-title { display: none; }
.entry-meta { font-size: 0.85rem; margin-bottom: 12px; color: #5a6a72; }
.entry-content { margin-bottom: 30px; }
.entry-content p { margin-bottom: 1em; }
.entry-content ul, .entry-content ol { margin: 0 0 1em 1.5em; }
.entry-footer { font-size: 0.85rem; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #d5d5c8; }

/* === FOOTER === */
.site-footer { text-align: center; padding: 20px; font-size: 0.85rem; color: #5a6a72; background: #fff; border-top: 1px solid #d5d5c8; }

/* === FORMS (plugin compat) === */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], textarea, select {
    border: 1px solid #d5d5c8;
    padding: 8px 12px;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    border-radius: 4px;
}

button, input[type="submit"], input[type="button"] {
    padding: 8px 20px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    border-radius: 20px;
    border: 2px solid #2F7251;
    background: #2F7251;
    color: #fff;
    font-weight: 700;
    transition: background 0.15s;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: #1E5038;
    border-color: #1E5038;
}

/* === COMMENTS === */
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 12px 0; border-bottom: 1px solid #e8e8de; }
.comment-meta { font-size: 0.85rem; margin-bottom: 6px; color: #5a6a72; }

/* === ALIGNMENT === */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* === WP === */
.wp-caption { max-width: 100%; margin-bottom: 1em; }
.wp-caption-text { font-size: 0.85rem; padding-top: 5px; color: #5a6a72; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }

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

/* === PAGINATION === */
.nav-links { display: flex; justify-content: space-between; gap: 20px; margin: 20px 0; }
.page-numbers { padding: 6px 12px; border-radius: 4px; }
.page-numbers.current { font-weight: 700; background: #2F7251; color: #fff; }

/* === WIDGETS === */
.widget { margin-bottom: 25px; }
.widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.widget ul { list-style: none; padding: 0; }

/* === USER BAR — clean flat style === */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700;800&display=swap');

.flavor-user-bar {
    background: #fff;
    border-bottom: 1px solid #d5d5c8;
    position: sticky;
    top: 0;
    z-index: 100;
}
.flavor-user-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.flavor-user-greeting {
    font-family: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #5a6a72;
}
.flavor-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border: 1px solid #d5d5c8;
    border-radius: 20px;
    background: transparent;
    color: #5a6a72;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.flavor-user-btn:hover {
    border-color: #2F7251;
    color: #2F7251;
}
.flavor-btn-login {
    border-color: #2F7251;
    color: #2F7251;
}
.flavor-btn-login:hover {
    background: #2F7251;
    color: #fff;
}

@media (max-width: 768px) {
    .flavor-user-bar-inner { padding: 8px 16px; }
    .flavor-user-greeting { display: none; }
}

/* ═══════════════════════════════════
   HOMEPAGE TILE GRID
   ═══════════════════════════════════ */

.homepage-wrapper {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 50vh;
}
.homepage-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    pointer-events: none;
    z-index: 0;
}
.homepage-inner {
    position: relative;
    z-index: 1;
}
/* When background image is set, lighten the text */
[data-has-bg="1"] .homepage-title { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
[data-has-bg="1"] .homepage-description { color: rgba(255,255,255,0.9); text-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.homepage-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px 10px;
    text-align: center;
}
.homepage-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1E5038;
    margin: 0 0 10px;
}
.homepage-description {
    font-size: 1.05rem;
    color: #5a6a72;
    max-width: 700px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

.homepage-tiles {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 32px 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}

.homepage-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d5d5c8;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
    border-top: 5px solid var(--tile-accent, #2F7251);
}
.homepage-tile:hover {
    border-color: var(--tile-accent, #2F7251);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.homepage-tile-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #eee;
}
.homepage-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.homepage-tile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tile-accent, #2F7251);
    opacity: 0.12;
}
.homepage-tile-placeholder span {
    font-size: 64px;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
}

.homepage-tile-body {
    padding: 18px 20px;
    flex: 1;
}
.homepage-tile-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px;
}
.homepage-tile:hover .homepage-tile-title {
    color: var(--tile-accent, #2F7251);
}
.homepage-tile-desc {
    font-size: 0.9rem;
    color: #5a6a72;
    line-height: 1.5;
    margin: 0;
}

.homepage-tile-arrow {
    padding: 12px 20px;
    font-size: 18px;
    color: var(--tile-accent, #2F7251);
    border-top: 1px solid #e8e8de;
    text-align: right;
    font-weight: 700;
}

.homepage-tiles-empty {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    padding: 40px 20px;
    color: #5a6a72;
    background: #fff;
    border: 1px solid #d5d5c8;
    border-radius: 6px;
}

.homepage-page-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 32px 40px;
}

@media (max-width: 640px) {
    .homepage-tiles {
        grid-template-columns: 1fr;
        padding: 16px 16px 40px;
    }
    .homepage-hero {
        padding: 30px 16px 10px;
    }
    .homepage-title {
        font-size: 1.5rem;
    }
}

/* ═══════════════════════════════════
   EXPANDABLE TILES — submenu items
   ═══════════════════════════════════ */

.homepage-tile--expandable {
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

.homepage-tile-toggle {
    padding: 12px 20px;
    border-top: 1px solid #e8e8de;
    text-align: center;
    color: var(--tile-accent, #2F7251);
    font-size: 12px;
    transition: background 0.15s;
}
.homepage-tile--expandable:hover .homepage-tile-toggle {
    background: rgba(47,114,81,0.04);
}
.homepage-tile-toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}
.homepage-tile--expanded .homepage-tile-toggle-icon {
    transform: rotate(180deg);
}

.homepage-tile-submenu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e8e8de;
}
.homepage-tile--expanded .homepage-tile-submenu {
    display: block;
}
.homepage-tile-submenu li {
    border-bottom: 1px solid #e8e8de;
}
.homepage-tile-submenu li:last-child {
    border-bottom: none;
}
.homepage-tile-submenu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.homepage-tile-submenu a:hover {
    background: var(--tile-accent, #2F7251);
    color: #fff;
}
.homepage-tile-submenu a::after {
    content: '\2192';
    color: var(--tile-accent, #2F7251);
    font-weight: 700;
}
.homepage-tile-submenu a:hover::after {
    color: #fff;
}
